SqlDataAdapter有问题 [英] a problem with SqlDataAdapter

查看:100
本文介绍了SqlDataAdapter有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在那里
我从这里阅读了您的文章:http://www.codeproject.com/KB/database/sqldawithoutsqlcb.aspx"
我使用了这段代码:

hi there
I read your article from here:http://www.codeproject.com/KB/database/sqldawithoutsqlcb.aspx"
and I used this code:

string connection = "Server=NIMIS\\TEST;database=Projects;integrated security=true";
string query="UPDATE fest SET nwem=''6'' WHERE num=''20''";
SqlConnection mycon = new SqlConnection(connection);
SqlDataAdapter mydaap = new SqlDataAdapter("select * from  fest", mycon);
SqlCommand up = new SqlCommand(query, mycon);
DataSet myset = new DataSet();
mydaap.Fill(myset, "fest");
mydaap.UpdateCommand = up;
mydaap.Update(myset, "fest");


但是我的桌子没有更新...
请帮我找出问题所在...
谢谢:thumbsup:


but my table did not updated...
please help me to find what is the problem problem...
thank you:thumbsup:

推荐答案

您没有执行命令!
up.ExecuteNonQuery();


这篇关于SqlDataAdapter有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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