Re: Create Update DS
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Mon, 5 Mar 2007 16:42:58 -0800
The Update method of the DataAdapter calls SQLServer one row at a time. It
checks the RowState; if it's an insert, it uses the InsertCommand; if it's
an update, it uses the Update Command, and so on. So you should be okay.
Robin S.
----------------------------
"Ornette" <abstrait...nospam...@xxxxxxx> wrote in message
news:8F8061D8-CD6A-4A2F-8EEA-FA239D0536A6@xxxxxxxxxxxxxxxx
Robin,
Yes it works great !
My only "problem" is that I don't know if the select (at the end of
Update SP and Create SP) is called for each row, or at the end for
everything, or...? because I don't know howUpdate() method of DataAdapter
calls SQL Server (create a DS for update, create a DS for Insert then
combine it ?).
I will try to see it with the SQL profiler
"RobinS" <RobinS@xxxxxxxxxxxxxxx> a écrit dans le message de
news:KK2dnfFFmY5xMnbYnZ2dnUVZ_ualnZ2d@xxxxxxxxxxxxxx
Oh, I see, you're talking about regenerating all of your columns. I
don't see why it wouldn't work. You've gotten it to work now?
Robin S.
----------------------------------------
"Ornette" <abstrait...nospam...@xxxxxxx> wrote in message
news:BE3E06E2-6852-4B84-AA6E-DD14B49290BA@xxxxxxxxxxxxxxxx
Hello,
(for info only)
My Create SP uses the auto id (generated bu sql server) combined with
dates and other tables contents to generate sort of "Custom Guid".
My Update SP generates date of modification and other parameters
generated from other tables.
I use a DataAdapter and it works as you said, except I need to put
"Select columns from table where id=@@identity" at the end for the
dataset to be filled with these generated values. If I don't add this
select statement at the end of the SP, the generated columns in
database are not copied in the dataset (that's normal).
Thank you for your comments.
"RobinS" <RobinS@xxxxxxxxxxxxxxx> a écrit dans le message de
news:atWdnQuPgerGjnbYnZ2dnUVZ_qqrnZ2d@xxxxxxxxxxxxxx
I don't know how you're doing your updates, or what your SP looks like.
If you have a DataSet and are submitting the updates using a
DataAdapter, it iterates through the rows and performs each
update/delete/insert as needed, so it should retrieve the updated
identity column value as it goes.
Robin S.
---------------------------
"Ornette" <abstrait...nospam...@xxxxxxx> wrote in message
news:A0721519-4023-47E7-A61D-B9D35A949A0E@xxxxxxxxxxxxxxxx
Ok, sorry it was not so clear.
I have an update sotred procedure wich generates values in SQL
Server.
I replaced the output parameted with a Select ... @@Identity at the
end of the procedure.
It seems ok, but I don't know what exaclty will happen when I will
send an entire dataset with multiples row added, modified and deleted
to the Update() function (which calls Insert, Update and Delete
stored procedures)...
Ornette.
"RobinS" <RobinS@xxxxxxxxxxxxxxx> a écrit dans le message de
news:vIidnXOYscCwuXfYnZ2dnUVZ_ualnZ2d@xxxxxxxxxxxxxx
I don't understand what you mean.
Does your stored procedure generate values in the table in
SQLServer? Or are you trying to write data to the table in
SQLServer? Or do you have data in the table in SQLServer, and are
trying to read it?
Robin S.
------------------------------------
"Ornette" <abstrait...nospam...@xxxxxxx> wrote in message
news:123035CB-D242-4BAE-96D8-20F97975D88B@xxxxxxxxxxxxxxxx
Hello,
I have a stored procedure which generates some values in the table.
When I use update() how to populate the dataset with theses values
?
For the moment I use output parameter but it just works for 1 row
and as the dataset doesn't have the value I should put it after and
the rowstate goes to "modified"...
Any ideas ?
SIncerly,
.
- Follow-Ups:
- Re: Create Update DS
- From: Ornette
- Re: Create Update DS
- References:
- Re: Create Update DS
- From: RobinS
- Re: Create Update DS
- From: Ornette
- Re: Create Update DS
- From: RobinS
- Re: Create Update DS
- From: Ornette
- Re: Create Update DS
- From: RobinS
- Re: Create Update DS
- From: Ornette
- Re: Create Update DS
- Prev by Date: Re: .NET 3.0 Framework and VS.NET 2003
- Next by Date: Re: windows\system32\config
- Previous by thread: Re: Create Update DS
- Next by thread: Re: Create Update DS
- Index(es):
Relevant Pages
|
Loading