PC Review


Reply
Thread Tools Rate Thread

Data Inserts using DataAdapter

 
 
=?Utf-8?B?c2FtZWVy?=
Guest
Posts: n/a
 
      8th Dec 2005
hi,

this is something very basic that i am trying to get done here.
i want to update and insert record to the database using a dataadapter which
would use Update and insert stored procs. this is easy and i can handle that,
but for inserts my stored proc returns a RowId which is generated in the
database after the record is inserted. Is there any way using a dataadapter
that when a record is inserted in the database using the insert command, i
grab the rowid value that is returned by my SP , then insert this value in
the row (in the datatable that was just inserted in the database) and return
it to the user.

I dont want to use output parameters in the insert Stored proc because it
might be possible that i might want to return more columns, the insert SP
does a "select <rowid>" as the last command in it after doing the insert of
the row.

can any one suggest how?
 
Reply With Quote
 
 
 
 
Jay Pondy
Guest
Posts: n/a
 
      9th Dec 2005
I don't see how using an Output Parameter and the ADO.Net mapping
features to return the RowID will prevent you from returning it
(again) and more columns in the last command.



On Thu, 8 Dec 2005 12:26:02 -0800, sameer
<(E-Mail Removed)> wrote:

>hi,
>
>this is something very basic that i am trying to get done here.
>i want to update and insert record to the database using a dataadapter which
>would use Update and insert stored procs. this is easy and i can handle that,
>but for inserts my stored proc returns a RowId which is generated in the
>database after the record is inserted. Is there any way using a dataadapter
>that when a record is inserted in the database using the insert command, i
>grab the rowid value that is returned by my SP , then insert this value in
>the row (in the datatable that was just inserted in the database) and return
>it to the user.
>
>I dont want to use output parameters in the insert Stored proc because it
>might be possible that i might want to return more columns, the insert SP
>does a "select <rowid>" as the last command in it after doing the insert of
>the row.
>
>can any one suggest how?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excell data input form that links to/inserts data to Access Databa =?Utf-8?B?TWF0dGhldw==?= Microsoft Access Form Coding 1 13th Nov 2007 05:31 PM
Slow inserts using SQL Data Adapter Chris Botha Microsoft ADO .NET 5 20th Dec 2004 08:47 PM
Database schema and data inserts ? Stuart Crow Microsoft Access External Data 1 29th Sep 2004 01:50 AM
Database schema and data inserts ? Stuart Crow Microsoft Access 2 28th Sep 2004 12:56 PM
Can I have a form that inserts multiple data Chris Microsoft Access Forms 2 3rd Jul 2003 12:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 AM.