C# DataSet为何得到的Table为空?急 本帖最后由 chyude 于 2011-08-02 16:35:12 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这种问题,只有自己调试了,设个断点,看看空数据时,CommandText 值是什么,拷贝到查询分析器里执行,看看会有什么结果。 Command.CommandText = PublicLibrary.CHARSET_STRING + Command.CommandText;你调试的时候看看这个值是什么?? Command.CommandText 的内容你跟踪一下,我看了前面感觉你在用视图,对不 protected static MySqlDataAdapter CreateAdapter(MySqlCommand myCommand, MySqlConnection dbConnection) { MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand); MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter); testAdapter.SelectCommand.Connection = dbConnection; return testAdapter; } 打个断点跟一下,看看Command.CommandText 得到的值是啥,一步一步的进去调试。我刚写程序的时候一出问题,要么找人帮忙看,要么乱猜一通,自己学会调试后出现错误,就自己调,基本不怎么麻烦别人了,呵呵 你的comand和connection都没有关联吧 Command需要设置他的查询字符串和连接对象Connection,构造函数就已经告诉你了。是不是这个问题试试 SqlConnection con = new SqlConnection(""); SqlCommand com = new SqlCommand("", con);借鉴,希望有帮助 protected static MySqlDataAdapter CreateAdapter(MySqlCommand myCommand, MySqlConnection dbConnection) { MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand); MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter); testAdapter.SelectCommand.Connection = dbConnection; return testAdapter; } 【求助!】调用Excel.Application.quit方法 关不掉EXCEL进程 C#中的方法调用出现问题 这个sql语句怎么写? 大家好,问个问题 【请问高手】C#如何同步两个listview的滚动条呀,即拖动一个,另一个也跟着动? 各位大大,急切求助:help 怎么样把word文件保存到sql数据库里面 控件Image的Source属性,如何用imagebrush对象来填充?? 如何输出字符串中转义字符? 请问如何汇出数据库字段中某依字段的资料值到 Word. Gridview分页后导出excel,只能导入一页 帮忙看一下这个软件功能是用什么控件实现的??
{
MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand);
MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter);
testAdapter.SelectCommand.Connection = dbConnection;
return testAdapter;
}
SqlCommand com = new SqlCommand("", con);借鉴,希望有帮助
{
MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand);
MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter);
testAdapter.SelectCommand.Connection = dbConnection;
return testAdapter;
}