Visual Studio 2008 SQL data source

I have a SELECT statement that selects 4 different fields from a SQL Data Source in Visual Studio 2008.  What I would like to be able to do is execute an UPDATE statement on 3 other, different fields that are in the same table as the SELECT statement, but fields that are not in the SELECT statement.  I can't find out how to accomplish this.
zintechAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Manoj PatilConnect With a Mentor Sr. Software EngineerCommented:
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
To update a table you need an update statement, not a select statement.  eg.:
UPDATE [TableNameGoesHere] SET Col1 = "xxx", Col2 = "yyyy" WHERE (UniqueIndexOrKeyFieldNameGoesHere=1)
0
 
zintechAuthor Commented:
I understand that.  I have an SQLDataSource attached to a GridView on the page that displays the fields and data form the datasource on the gridview and when the user clicks 'Edit' and then 'Update' on the Gridview I would like the UPDATE statement form the DataSource to run.  The SQL DataSource only gives the option to add Parameters to the query from the SELECT statement
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
You need to fill the UpdateCommand of the gridview with the sql update command you want to execute
0
All Courses

From novice to tech pro — start learning today.