如何使用Asp.Net代码更新来自另一个表的表比较常见字段 [英] How Do I Update Table From Another Table Comparing Common Fields Using Asp.Net Code

查看:76
本文介绍了如何使用Asp.Net代码更新来自另一个表的表比较常见字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从另一个表更新表使用asp.net代码比较常见字段







但< b>不通过文本输入

SqlConnection connAdd = new SqlConnection(Data Source = localhost; Initial Catalog = project; Integrated Security = SSPI);



connAdd.Open();

string mySQLL;

mySQLL =更新报告设置句柄='处理'其中caseid ='+ lblCID.Text +';

SqlCommand cmdAdd = new SqlCommand(mySQLL,connAdd);

cmdAdd.ExecuteNonQuery();



connAdd.Close();





i想要复制已存在于另一个表中的数据..

update table from another table comparing common fields using asp.net code



but not through text entry
SqlConnection connAdd = new SqlConnection("Data Source = localhost; Initial Catalog = project; Integrated Security= SSPI");

connAdd.Open();
string mySQLL;
mySQLL = "Update Report Set handle = 'handled' where caseid='"+lblCID.Text+"'";
SqlCommand cmdAdd = new SqlCommand(mySQLL, connAdd);
cmdAdd.ExecuteNonQuery();

connAdd.Close();


i want to copy data which s already exist in another table..

推荐答案

试试这个:

Try this:
SELECT column_name(s)
INTO newtable [IN externaldb]
FROM existingtable;


这篇关于如何使用Asp.Net代码更新来自另一个表的表比较常见字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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