Stored procedures in dataset

  • Thread starter Jon Haakon Ariansen
  • 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
 
C

Cor Ligthert [MVP]

Jon,

AFAIK is a new Guid never standard automaticly insterted. You have to add
that in your procedures.

An auto integer is something else, but I would use that Guid, the autokey
gives only troubles in AdoNet as soon as you have a relation.

A better newsgroup for your question about adonet is by the way.

microsoft.public.dotnet.framework.adonet

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top