PC Review


Reply
Thread Tools Rate Thread

DataAdapter Commands

 
 
Charles
Guest
Posts: n/a
 
      14th Feb 2006
I would appreciate some help, or direction, in understanding two things
about using the DataAdapter's update method. The first issue I have is
the DataAdapter and Table need to be declared in the same procedure as
the three commands. Usally, this is done at the begining of a Web Form
to display data. Unless I am doing something wrong, once you leave
that procedure you loose those declarations. Since you send updates
back to the data source at the end you would need to maintain the
declarations. It seems that using a session variable would not be a
good idea because the session is likely to time out. If you use public
variables you are going to end up with a lot varables.

The second area is using the insert, delete and upate commands from a
stored procedure. I cannot seem to find any clear documentation on how
do this.

Again, I would really appreciate some feedback on this.

Thanks
Charles

 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      14th Feb 2006
Charles:

They don't need to be declared in the same method, function class or even
assembly and often aren't. If you're using the autogenerated tools then it
does it in the UI layer but as a general rule, it's something that should be
avoided. MSN Search for Data Access Application Block, seeing how this was
constructed should shed a lot of light on your current situation

To use a Stored Procedure, you need to set the Command's CommandType to
Stored Procedure and then just use the proc name as the Command Text. Then
add parameters if there are any. This should help
http://www.c-sharpcorner.com/Code/20...nsOutsinCS.asp
"Charles" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I would appreciate some help, or direction, in understanding two things
> about using the DataAdapter's update method. The first issue I have is
> the DataAdapter and Table need to be declared in the same procedure as
> the three commands. Usally, this is done at the begining of a Web Form
> to display data. Unless I am doing something wrong, once you leave
> that procedure you loose those declarations. Since you send updates
> back to the data source at the end you would need to maintain the
> declarations. It seems that using a session variable would not be a
> good idea because the session is likely to time out. If you use public
> variables you are going to end up with a lot varables.
>
> The second area is using the insert, delete and upate commands from a
> stored procedure. I cannot seem to find any clear documentation on how
> do this.
>
> Again, I would really appreciate some feedback on this.
>
> Thanks
> Charles
>



 
Reply With Quote
 
Charles
Guest
Posts: n/a
 
      15th Feb 2006

W.G. Ryan - MVP wrote:
> Charles:
>
> They don't need to be declared in the same method, function class or even
> assembly and often aren't. If you're using the autogenerated tools then it
> does it in the UI layer but as a general rule, it's something that should be
> avoided. MSN Search for Data Access Application Block, seeing how this was
> constructed should shed a lot of light on your current situation
>
> To use a Stored Procedure, you need to set the Command's CommandType to
> Stored Procedure and then just use the proc name as the Command Text. Then
> add parameters if there are any. This should help
> http://www.c-sharpcorner.com/Code/20...nsOutsinCS.asp
> "Charles" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I would appreciate some help, or direction, in understanding two things
> > about using the DataAdapter's update method. The first issue I have is
> > the DataAdapter and Table need to be declared in the same procedure as
> > the three commands. Usally, this is done at the begining of a Web Form
> > to display data. Unless I am doing something wrong, once you leave
> > that procedure you loose those declarations. Since you send updates
> > back to the data source at the end you would need to maintain the
> > declarations. It seems that using a session variable would not be a
> > good idea because the session is likely to time out. If you use public
> > variables you are going to end up with a lot varables.
> >
> > The second area is using the insert, delete and upate commands from a
> > stored procedure. I cannot seem to find any clear documentation on how
> > do this.
> >
> > Again, I would really appreciate some feedback on this.
> >
> > Thanks
> > Charles
> >

William,
This is what I was looking for! Thanks for the information.
Charles

 
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
Control References in DataAdapter Commands Christopher Weaver Microsoft C# .NET 4 4th May 2005 07:49 PM
Parameters with DataAdapter commands Predrag Microsoft ADO .NET 1 17th Mar 2004 02:51 PM
run Insert/Delete DataAdapter commands? Rich Microsoft VB .NET 2 10th Feb 2004 06:59 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ADO .NET 1 12th Dec 2003 05:58 PM
DataAdapter using commandbuilder's commands, not it's own. Marina Microsoft ASP .NET 1 12th Dec 2003 04:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 AM.