使用SQL查询将gridview中的一列数据复制到另一列 [英] Copy one column data in gridview to other column using sql query

查看:94
本文介绍了使用SQL查询将gridview中的一列数据复制到另一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用sql查询将gridview中的一列数据复制到另一列中

我在gridview中有两个datetime列,我想将一个列的数据复制到另一列中..

请帮助我....

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....

推荐答案

不清楚您的问题.我对此问题的看法是,如果您的列包含要复制的相同值,则无需复制,只需添加具有不同含义的字段,例如

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


执行此操作,您可以看到名称"字段包含两列,其中一列是名称",另一列是stdName

试试这个.

谢谢


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

try this.

Thanks


在gridview updatecommand中编写查询

查询样例.
In gridview updatecommand write the query

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



ASP.Net GridView更新命令 [



ASP.Net GridView Update Command[^]


这篇关于使用SQL查询将gridview中的一列数据复制到另一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆