PC Review


Reply
Thread Tools Rate Thread

Deleting a row

 
 
Ronny
Guest
Posts: n/a
 
      12th Oct 2008
When deleting a row I set the SelectCommand property in order to create the
dataset and the DeleteCommand property.
Do I have to set the InsertCommans and the UpdaeCommand also?

Regards
Ronny


 
Reply With Quote
 
 
 
 
daveL
Guest
Posts: n/a
 
      12th Oct 2008
all commands of sqldataadapter only need to be set if
there gonna be used

DaveL

"Ronny" <(E-Mail Removed)> wrote in message
news:eJH%23%(E-Mail Removed)...
> When deleting a row I set the SelectCommand property in order to create
> the dataset and the DeleteCommand property.
> Do I have to set the InsertCommans and the UpdaeCommand also?
>
> Regards
> Ronny
>



 
Reply With Quote
 
 
 
 
Ronny
Guest
Posts: n/a
 
      14th Oct 2008
Thanks,
But this is exactly my question...
When using Update, in order to push data back to the database the ADO.NET
uses the prepared command automatically and I don't know if it needs also
those that I mentioned.
Regards
Ronny
"daveL" <(E-Mail Removed)> wrote in message
news:mJnIk.4699$(E-Mail Removed)...
> all commands of sqldataadapter only need to be set if
> there gonna be used
>
> DaveL
>
> "Ronny" <(E-Mail Removed)> wrote in message
> news:eJH%23%(E-Mail Removed)...
>> When deleting a row I set the SelectCommand property in order to create
>> the dataset and the DeleteCommand property.
>> Do I have to set the InsertCommans and the UpdaeCommand also?
>>
>> Regards
>> Ronny
>>

>
>



 
Reply With Quote
 
daveL
Guest
Posts: n/a
 
      16th Oct 2008
if you have a identity key from your select
then the update will only up rows that were changed

I always build my own update command using the table.schema....
SqlcommandBuilder works wonders
for most if not all normal updates

work with it with test data till u get a handle with adapter.update()

try sqlcommandbuilder print the commands it creates out
so you can see what it is acually doing

DaveL

"Ronny" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks,
> But this is exactly my question...
> When using Update, in order to push data back to the database the ADO.NET
> uses the prepared command automatically and I don't know if it needs also
> those that I mentioned.
> Regards
> Ronny
> "daveL" <(E-Mail Removed)> wrote in message
> news:mJnIk.4699$(E-Mail Removed)...
>> all commands of sqldataadapter only need to be set if
>> there gonna be used
>>
>> DaveL
>>
>> "Ronny" <(E-Mail Removed)> wrote in message
>> news:eJH%23%(E-Mail Removed)...
>>> When deleting a row I set the SelectCommand property in order to create
>>> the dataset and the DeleteCommand property.
>>> Do I have to set the InsertCommans and the UpdaeCommand also?
>>>
>>> Regards
>>> Ronny
>>>

>>
>>

>
>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      17th Oct 2008
Yes,

But as Dave wrote, in most simple situations (by instance less than 100
columns, no broken columnnames and no relations) you can use the
commandbuilder much easier.

Cor

"Ronny" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Thanks,
> But this is exactly my question...
> When using Update, in order to push data back to the database the ADO.NET
> uses the prepared command automatically and I don't know if it needs also
> those that I mentioned.
> Regards
> Ronny
> "daveL" <(E-Mail Removed)> wrote in message
> news:mJnIk.4699$(E-Mail Removed)...
>> all commands of sqldataadapter only need to be set if
>> there gonna be used
>>
>> DaveL
>>
>> "Ronny" <(E-Mail Removed)> wrote in message
>> news:eJH%23%(E-Mail Removed)...
>>> When deleting a row I set the SelectCommand property in order to create
>>> the dataset and the DeleteCommand property.
>>> Do I have to set the InsertCommans and the UpdaeCommand also?
>>>
>>> Regards
>>> Ronny
>>>

>>
>>

>
>



 
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
Locating the row that has no values. Selecting that row till the last row after that and deleting it? VB Script for Excel Microsoft Excel Programming 2 25th May 2006 01:19 PM
deleting row but wanted the row numbers in running order ? =?Utf-8?B?dGlrY2h5ZV9vbGRMZWFybmVyNTc=?= Microsoft Access 2 17th May 2006 01:43 PM
after sorting listview when I tried to remove any row from listview its deleting different row Adi Tan via .NET 247 Microsoft Dot NET 1 31st Mar 2005 08:22 AM
Deleting Child Row Deletes Parent Row? akarchm01_nospam@yahoo.com Microsoft ADO .NET 0 15th Dec 2004 05:23 PM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Microsoft Excel Programming 1 5th Mar 2004 10:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 AM.