Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Copy one column data in gridview to other column using sql query

I have two datetime columns in gridview i want to copy one column data into other column..

Please help me....
Posted
Comments
Prerak Patel 11-Jul-11 1:27am    
Not clear. Using sql to copy data in GridView?!

not clear about your question. my opinion for this question that if your column contain same value that you want to copy so no need to copy just add field with different alise for example

SELECT ID, Name, Name as stdName, Address from table1

execute thsi qry you can see the Name field conten with two column one is Name another is stdName

try this.

Thanks
 
Share this answer
 
Comments
Ramakrishna Alla 11-Jul-11 1:53am    
My query is i have two columns Like DateTime1,DateTime2, in gridview & i have button when i click button the data in DateTime1 has to copy into DateTime2.
In gridview updatecommand write the query

Example Query like.
SQL
UPDATE [Table] SET DataTime1=@DateTime2 WHERE ID=@ID


ASP.Net GridView Update Command[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900