Solved

Update command in SQLDataSource

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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…

707 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