现在的位置: 首页 > 综合 > 正文

在MySql里面查询有记录,但是调用程序执行就没有记录

2013年03月15日 ⁄ 综合 ⁄ 共 527字 ⁄ 字号 评论关闭

1、Select * From chuang_AgentInfo Where UserName='成都'  --在MySql工具里面查询有记录

2、以下代码查询上面语句,没有记录table.row.count为0
MySqlCommand thisCommand = new MySqlCommand();
thisCommand.CommandTimeout = 0;

// make sure connection is open
MySqlConnection con = new MySqlConnection(vStrConn);
try
{
    con.Open();
    thisCommand.Connection = con;
thisCommand.CommandText = SQL;

    MySqlDataAdapter thisAdapter = new MySqlDataAdapter();
    thisAdapter.SelectCommand = thisCommand;
    DataTable table = new DataTable();
    thisAdapter.Fill(table);
    return table;
}

3、以上代码查询 Select * From chuang_AgentInfo 有记录,可以查到。

抱歉!评论已关闭.