高手看看这行代码怎么写,来看看
public void bind()
{
string sqlstr = "select id,name,Pass from Admin where name= ' " + Session[ "SysUsers "].ToString() + " ' ";
sqlcon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds);
GridView1.DataKeyNames = new string[] { "id " };
DataView view = myds.;//这一行怎么写?原来查表里的全部数据用的是DataView view = myds.Tables[ "Admin "].DefaultView
string sort = (string)ViewState[ "SortOrder "] + " " + (string)ViewState[ "OrderDire "];
view.Sort = sort;
GridView1.DataSource = view;
GridView1.DataBind();
sqlcon.Close();
}
------解决方案--------------------DataView view = myds.Tables[0].DefaultView;