Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 12th, 2005, 08:39 AM
Authorized User
 
Join Date: Mar 2004
Location: Maumee, OH, USA.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Command Builder

I'm trying to use the command builder to generate my Update command for a MySQL table. I pass in the Select statment and the update query is created correctly. However, when it updates the database a new record is created instead of updating the original record. Below is a sample Select query passed in to the command builder.

SELECT * FROM IndAccums WHERE SS = '111222333' AND Year = '2005' AND
PatientID = '888999XX'

Any idea why it would create a new record instead of actually performing the update?
  #2 (permalink)  
Old April 12th, 2005, 01:28 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Are you using a command object or a sql data adapter?

I believe you need to use the data adapter in order for it to generate the other SQL commands automatically.
  #3 (permalink)  
Old April 18th, 2005, 08:01 AM
Authorized User
 
Join Date: Mar 2004
Location: Maumee, OH, USA.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jbenson001
 Are you using a command object or a sql data adapter?

I believe you need to use the data adapter in order for it to generate the other SQL commands automatically.
No, I am using the data adapter to generate the commands. It actually generates the commmand correctly, as far as I can tell, but the update does not go as expected.
  #4 (permalink)  
Old April 18th, 2005, 12:03 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Can you post your code that calls the UPDATE?


Similar Threads
Thread Thread Starter Forum Replies Last Post
course builder youyou_hym Dreamweaver (all versions) 1 May 28th, 2008 03:09 AM
Command text was not set for the command object Sheraz Khan Classic ASP Databases 2 May 29th, 2007 12:57 AM
C++ Builder Programming nbnichit C++ Programming 0 January 20th, 2007 01:45 AM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.