摘要:
这个错误第一次遇到的时候感到很莫名,就是说比如我的语句是cmd.Parameters.Add("@BookReserve", SqlDbType.Int, 4); cmd.Parameters["@BookReserve"].Value = entity.BookReserve我单步调试发现,通过Add方法,BookReserve已经在SqlParameterCollection 存在了,可是为什... 阅读全文
摘要:
可以在打开连接语句外套一个判断语句if (conn.State ==ConnectionState.Closed) { conn.Open();}或者查看open语句外部是否已经包裹了open的语句如:public ***** (){ SqlConnection conn = new SqlConnection(*********); conn.open() using(**********... 阅读全文
摘要:
private void DataTable2Excel(System.Data.DataTable dtData, String FileName) { System.Web.UI.WebControls.GridView dgExport = null; // System.Web.HttpContext curContext = System.Web.HttpContext.Curren... 阅读全文