dataset - Insert-query with stored procedure using wizard

  • Thread starter Thread starter Jon Haakon Ariansen
  • Start date Start date
J

Jon Haakon Ariansen

Hi all,

I don't know where to publish this question but hope this newsgroup is okey.

I'm working in Visual Studio 2005 and are now creating a dataset file where
I will do all the transactions with the database.

I have a consumer table where I want to insert, update and delete consumers.
In the database I use uniqueidentifier on the primary key and said that it
is a rowGuid - (newid()).

When I try to generate a stored procedure to insert new consumers I have to
insert without adding the primary key because it is automatically generated
on a new insertion. However when using the wizard to generate the stored
procedure the wizard fails when I remove the primary key.
After the insert query the wizard created a select query with a where -
clause like the primary key variable.
(uidConsumerID = @uidConsumerID). Here I changed to SCOPE_IDENTITY( )
instead to get the databaserow from the current scope.
But this fails.

So what's wrong? What is the best way to make an insertion to a row using
RowGuid on the primary key?
Until further I will try to create the sp manually in the database and force
dotnet to use my own stored procedure.

In advance thanks a lot for your help!

Kind regards,

Jon Haakon
 
Jon,

If you use Outlook Express, than we will be obliged if you don't multipost.

With Crossposting (sending one message to relevant newsgroups) is no problem
in the dotnet Newsgroups.

I have answered your question in another newsgroup.

Thanks in advance.

Cor
 
Hi Cor,

Thanks for quick reply.
I'm sorry that I posted a question on two places. I found "...general"
first.
Then I found "...adonet" and published there afterwards.

To solve my problem I tured off "Is RowGuid" in the database and instead
create
a guid inside the stored procedure. And do a select with this guid to return
a rowset
to get the generated guid.

Thanks for help,

Jon Haakon
 
Back
Top