Solved

Visual Studio 2008 SQL data source

Posted on 2012-04-02
4
334 Views
Last Modified: 2012-04-12
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.
0
Comment
Question by:zintech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 37796531
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
 

Author Comment

by:zintech
ID: 37796546
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 37796604
You need to fill the UpdateCommand of the gridview with the sql update command you want to execute
0
 
LVL 19

Accepted Solution

by:
Manoj Patil earned 500 total points
ID: 37797840
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question