我在协会中撰写了一部法典。 NET读到SQ表的数据,并在Grid View中展示,并使用Row Data Bound活动。 但是,在我管理该方案时,这一例外产生于“一种不相干的类型系统例外”。
private void BindAllUsers()
{
SqlDataAdapter da = new SqlDataAdapter("SELECT ID, Name, Email, Password, Contact, CreatedOn, CreatedBy,CreatedIP From tbl_Users",con);
DataSet ds = new DataSet();
da.Fill(ds); <------(Error occurs in this line)
gdv_Users.DataSource = ds;
gdv_Users.DataBind();
}
罗达塔·博迪 活动管理员是:
protected void gdv_Users_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[0].Style["Cursor"] = "hand";
e.Row.Cells[0].ToolTip = "Click Here";
e.Row.Cells[0].Attributes.Add("onclick","window.open( Details.aspx ?ID=" + e.Row.Cells[0].Text.ToString()+" Details ; width = 735,height= 350,left = 220,top = 300,resizable = 0,scrollbars = 0,status = no )");
}
The BindAllUser Function is listed here:
protected void Page_Load(object sender, EventArgs e)
{
BindAllUsers();
BindDropDown();
}