473,465 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Stored procedures in dataset

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
Aug 21 '06 #1
1 1147
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

"Jon Haakon Ariansen" <jo**@spama.noschreef in bericht
news:eH*************@TK2MSFTNGP06.phx.gbl...
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

Aug 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jeff Wang | last post by:
Hi all, Can someone help me out? I've been struggling with this for almost a week and still have no clue what's wrong. Basically I want to write a DB2 stored procedure for OS/390 in REXX. In...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
45
by: John | last post by:
Hi When developing vb.bet winform apps bound to sql server datasource, is it preferable to use SELECTs or stored procedure to read and write data from/to SQL Server? Why? Thanks Regards
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
0
by: george | last post by:
Hi world! Anyone experienced building gridview in Oracle environment using stored procedures, please help! Right now, I have issues using Oracle SP, I spent a whole day on this and still...
2
by: Fir5tSight | last post by:
Hi, I'll need to replace an existing stored procedure (let's call it old_SP), with a new one (let's call it new_SP) in a Visual Studio .NET project. Here's what I did: 1) Open...
2
by: GaryDean | last post by:
With ASP.Net 2.0 applications I am used to accessing data by using a 2.0 dataset and using the dataset wizard to create the tableadapter. I always (until now) have specified creation of embedded...
3
by: GaryDean | last post by:
In a new 2.0 website I am developing I am using .XSD tableadapters, building them with the wizard), and choosing the Stored Procedure option. I now notice that when I go back to change the sql...
5
by: Bogdan | last post by:
Hi, I have a stored procedure that uses JOINs to return columns from multiple tables. I also have another stored proc that that takes a series of params and updates multiple tables. I used the...
2
by: E11esar | last post by:
Hi there. I am writing a web service in C# that connects to an Oracle database via OleDb and wish for the service to return a dataset for use by a client application. I have achieved this using...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.