Solved

Update command in SQLDataSource

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Chat Room 1 29
SQL Inner Join Vs SubQueries 9 25
Events in static methods 3 27
Close word object 13 21
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now