每次绑定都错先错误,错误提示为: 输入字符串不正确
代码如下:
protected void bind()
{
string sqlvv = "select * from notice"+sql+" order by noticeDate desc";
bc.ExecGridView(GridView1, sqlvv);
}
ExecGridView方法如下:
public void ExecGridView(GridView gv,string sqlstr)
{
string settings = Convert.ToString(ConfigurationManager.ConnectionStrings["SmallHouseConn"]);
sqlcon = new SqlConnection(settings);
sqlcon.Open();
SqlDataAdapter ada=new SqlDataAdapter(sqlstr,sqlcon);
DataSet ds=new DataSet();
ada.Fill(ds);
gv.DataSource=ds;
gv.DataBind();//这短代码提示错误
sqlcon.Close();
}
好像是日期的格式错误 求大神请教 ,急急急!!
代码如下:
protected void bind()
{
string sqlvv = "select * from notice"+sql+" order by noticeDate desc";
bc.ExecGridView(GridView1, sqlvv);
}
ExecGridView方法如下:
public void ExecGridView(GridView gv,string sqlstr)
{
string settings = Convert.ToString(ConfigurationManager.ConnectionStrings["SmallHouseConn"]);
sqlcon = new SqlConnection(settings);
sqlcon.Open();
SqlDataAdapter ada=new SqlDataAdapter(sqlstr,sqlcon);
DataSet ds=new DataSet();
ada.Fill(ds);
gv.DataSource=ds;
gv.DataBind();//这短代码提示错误
sqlcon.Close();
}
好像是日期的格式错误 求大神请教 ,急急急!!
首先检查sql语句对不对?ds有值吗?
{
string sqlvv = "select * from notice"+sql+" order by noticeDate desc";
bc.ExecGridView(GridView1, sqlvv);
}
传的sql参数呢?