public static DataSet ExecuteDataset(string connectionString, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
{
if (connectionString == null || connectionString.Length == 0) throw new ArgumentNullException("connectionString"); // Create & open a SqlConnection, and dispose of it after we are done
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open(); // Call the overload that takes a connection in place of the connection string
return ExecuteDataset(connection, commandType, commandText, commandParameters);
}
}
上面的代码是MS的sqlHelper,我用了之后发现网站经常出现列xxx不属于表table的错误
不知道是不是上面的方法的错误,急急急,现在网站正在搞活的
解决方案 »
- 什么情况下使用静态的东东?SQLHELP用static好吗?
- asp.net rdlc报表 无法添加报表数据源
- FileMode.Create为什么不覆盖存在的文件?
- 对于 App_Code 文件夹下面的类有没有办法指定程序集名称?
- 求下拉框dropdownlist自动执行代码
- 聊天室点击发言按钮而不刷新页面,怎么可以做的到?
- datagrid的设置问题
- 数据显示的问题
- asp.net2.0中插入Flash的问题,请高人解答
- extjs 2.0 使用gridPanel加载数据特别慢
- 这两个绑定语句有什么不同?在什么地方用哪一个?
- 关于软件测试的问题! 是流程问题 非技术问题! 大家给点意见!!谢谢~高手!大侠!强人!
这个也不是关没关连接的错啊!
总数列 XX不属于表table而且调试没有问题,压力测试就会有问题
但是就是找不到原因,请各位帮帮忙
using语句结束会调用connection的dispose()方法的现在网站一直错误啊,还是找不到原因急急急啊
==
可能是你传的commandParameters多了,table里没有那个列,你查查sql语句
现在还是没有找到什么错误
列是不是一一匹配的
语句中的某一字段不是所查询表中的字段
public static DataSet ExecuteDataset(string connectionString, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
{
if (connectionString == null || connectionString.Length == 0) throw new ArgumentNullException("connectionString"); // Create & open a SqlConnection, and dispose of it after we are done
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open(); // Call the overload that takes a connection in place of the connection string
return ExecuteDataset(connection, commandType, commandText, commandParameters);
}
}
// Call the overload that takes a connection in place of the connection string
return ExecuteDataset(connection, commandType, commandText, commandParameters);
cmd.Parameters.Clear();