[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Update command in SQLDataSource

Posted on 2011-02-23
2
Medium Priority
?
269 Views
Last Modified: 2012-05-11
Hello all,

I am using SQL dsatasource  to bind the grid view. Now I am trying to eable update in the datagrid. The way I want is that of somebody updates the value in the Grid then it should be reflected in the database in the back.

I have some simple  query like

update X
set Column1 = @NewvalueColumn1
where
oldvalueColumn2= 'something'

Now here, where do I specify @NewvalueColumn1? Because that is somevalue coming from the Grid. How do I read that value?
0
Comment
Question by:TheCommunicator
2 Comments
 
LVL 9

Accepted Solution

by:
rajeevnandanmishra earned 2000 total points
ID: 34967426
Hi,

<<<
update X
set Column1 = @NewvalueColumn1
where
oldvalueColumn2= 'something' >>>
Are you able to get the value of "oldvalueColumn2"?
Normally if you bind the grid with a datasource, then you can make it enable for updates by setting the grid properties. Which grid you are using?

The "@NewvalueColumn1" can only be found from the current row of the Grid.

Please provide a little more detail and i hope soon you will get the solution.





0
 

Author Comment

by:TheCommunicator
ID: 34974158
I am using ASP Grid control.

That's what my question is thatwhen you say "The "@NewvalueColumn1" can only be found from the current row of the Grid."

How can I read the current row in Datagrid?

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

834 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