不是缓存cmd确实是静态的怎么定义好
解决方案 »
- WinForm+DataGride分页问题~在线等.急..
- 用户自定义控件属性的使用问题。
- 如何才能让GridView的视图“横过来”?--解决后立刻结帖
- 作为中国人,你还能保持平静吗--98年印泥华人大屠杀,惨无人道啊! (转贴)
- 把英文格式(如:18 May 2006 12:09:51)转化为2006-06-18 00:00:00,怎样转化.
- 关于上传文件的问题.急~~~
- 读取二进制图片(急等!!!)
- 新建web程序时总是提示“http/1.1 400 bad request”,什么原因亚,我修复了也是如此
- vs2005发布出错,没分了,希望大家能帮帮我,谢谢了
- 现有2张28号去广州,97次列车卧铺票,买重转售!!!
- 未能加载文件或程序集“DAL”或它的某一个依赖项。系统找不到指定的路径。
- Directory.GetFiles在网站上检索不到文件
我先测试下 #region 执行带参数的sql语句或存储过程,返回一个DataTable对象
/// <summary>
/// 执行带参数的sql语句或存储过程,返回一个DataTable对象
/// </summary>
/// <param name="cmdText">sql语句或存储过程名</param>
/// <param name="cmdType">命令类型</param>
/// <param name="cmdParms">参数集合</param>
/// <returns>返回一个DataTable对象</returns>
public static DataTable GetDataTable(string cmdText, CommandType cmdType, SqlParameter[] cmdParms)
{
SqlDataReader reader;
DataTable dt = new DataTable();
try
{
init();
SqlCommand cmd = new SqlCommand();
SetCommand(cmd, cmdText, cmdType, cmdParms);
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
dt.Load(reader);
reader.Close();
// conn.Close();//---
}
catch (Exception ex)
{
throw new Exception(ex.Message.ToString());
}
return dt;
}
#endregion
Server Error in '/' Application.
--------------------------------------------------------------------------------DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'type'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'type'.Source Error:
Line 105: <tr>
Line 106: <td style="text-align: left">
Line 107: <%#Eval("type")%>
Line 108: <a href="WriteInfo.aspx?id=<%#Eval("id")%>" target="_blank" title="<%#Eval("title")%>">
Line 109: <%#Eval("title") %></a>
public static SqlConnection conn = null;
public static string connstr = Maticsoft.DBUtility.PubConstant.GetConnectionString("connstr");