Solved

Update command in SQLDataSource

Posted on 2011-02-23
2
262 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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Slow Connectivity over ODBC 8 34
Footer for each row on Gridview 2 21
Update a text value in another table 10 39
ms sql + get number in list out of total 7 29
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
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…

770 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