Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

The TableAdapter update command is not identical

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ad - 04 Apr 2006 22:09 GMT
I am using vs2005 to desginer a tableadapter.

I have modify the update command in the desginer, but the update command is
not identical between the desginer.

For example:

The original update command is:

Update Employee set EmployeeID=@EmployeeID and EmployeeName=@EmployeeName
where EmployeeID=@Original_EmployeeID and
EmployeeName=@Original_EmployeeName

I change it in the designer to

Update Employee set EmployeeName=@EmployeeName where
EmployeeID=@Orginal_EmployeeID, and the count of parameter is 2.

But the commandtext in deginser.cs still remain the orginal become:

Update Employee set EmployeeName=@EmployeeName where
EmployeeID=@Orginal_EmployeeID ;
Select EmployeeID, EmployeeName form Employee where EmployeeID=@EmployeeID;

It also add a @EmployeeID parameter.

Why it add a select command below the update statement?
Jason M Penniman - 05 Apr 2006 00:26 GMT
The select statement is added to "refresh" the data in your dataset.
This ensures the data in the dataset matches the database.  It's best
practice when persisting data.

> I am using vs2005 to desginer a tableadapter.
>
[quoted text clipped - 23 lines]
>
> Why it add a select command below the update statement?
ad - 05 Apr 2006 02:33 GMT
Thank, I thought this select command is generated when I check "Refersh the data table" in DataTableAdapter wizard.
If I did not check, the Select command will not be generate after the update command.

But can I modify the "Refersh the data table" attribute after DataTableadapter wizard?

 "Jason M Penniman" <jpenniman@gmail.com> :1144193216.12280.9.camel@asclepius...
 The select statement is added to "refresh" the data in your dataset.  This ensures the data in the dataset matches the database.  It's best practice when persisting data.

 On Wed, 2006-04-05 at 05:09 +0800, ad wrote:
I am using vs2005 to desginer a tableadapter.

I have modify the update command in the desginer, but the update command is
not identical between the desginer.

For example:

The original update command is:

Update Employee set EmployeeID=@EmployeeID and EmployeeName=@EmployeeName
where EmployeeID=@Original_EmployeeID and
EmployeeName=@Original_EmployeeName

I change it in the designer to

Update Employee set EmployeeName=@EmployeeName where
EmployeeID=@Orginal_EmployeeID, and the count of parameter is 2.

But the commandtext in deginser.cs still remain the orginal become:

Update Employee set EmployeeName=@EmployeeName where
EmployeeID=@Orginal_EmployeeID ;
Select EmployeeID, EmployeeName form Employee where EmployeeID=@EmployeeID;

It also add a @EmployeeID parameter.

Why it add a select command below the update statement?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.