Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2004, 04:02 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generated dataset and autoincrement

I have created a SQLDataAdapter that uses stored procedures. When I run my app. it retrieves the data in the table but the ID field does not have the correct values in it. It seems that the Dataset's ID field is regenerating new id's for the this field. If I run my stored procedure from the Query Analyzer the id fields contents are correct. Does anyone know why I am not getting the correct values back.

Thanks,

David
 
Old May 14th, 2004, 12:47 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi drbradley,

Hope you found your solution.

I was wondering if you would be so kind as to share
w/ us how you created a dataAdapter that uses SPs.

Thanks !
 
Old May 15th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Use Configure Data Adapter on right-click on that!
after setting Connection select second type as (existing Stored porcedure) & go on ...

HTH

Always:),
Hovik Melkomian.
 
Old May 15th, 2004, 10:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

I don't know why it would be an incorrect ID... Do you specify any sort of autoincrementing on this field when setting up the data set, or are you doing anything else to that column specifically, or is coming back from the database that way?

Posting code may help some more also.

Brian
 
Old February 1st, 2005, 04:25 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I would also love to know how to get a recordset using a Stored Procedure through the SQLDataAdapter. I thought you had to use the
SQLCommand to run Stored Procedures...

I didn't understand Hovik's way to do it.

Could somebody please give a VB.NET coding example!

Thanks.

Rita
 
Old February 2nd, 2005, 01:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Hi Rita:
I dont remember what was my last post here, but to getting recordset is pretty simple!
use DataAdapter genaretor & it'll help u to set that (use SP & ...)
then u'll fill it in a table in DataSet.
like:
Code:
sqlDataAdapter1.Fill(DataSet1, "urTableName");
remember we have no recordset in ADO.NET, & its called DataSet.
HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
dataset and autoincrement primary key be03024 ADO.NET 8 July 19th, 2009 12:09 PM
AutoIncrement Aaron Edwards ASP.NET 2.0 Basics 5 February 7th, 2007 02:37 PM
Problem with dataset autoincrement column Jayaram ADO.NET 0 December 4th, 2006 03:13 PM
setting autoincrement tbecker82 Access 3 June 20th, 2006 01:17 PM
PrimaryKeys, AutoIncrement gbilios VB.NET 2002/2003 Basics 4 June 9th, 2005 07:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.