System.Data.SqlClient.SqlException: 列名 '单位' 无效
String sqlStr = "select UserID,Category,StartIP,TerminationIP,RoomDistribution,UserUuit from IPv4 " + whereStr + "order by UserID";
SqlDataAdapter sda = new SqlDataAdapter(sqlStr, con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
this.GridView1.DataBind();
GridView1.DataKeyNames = new string[] { "UserID" };
con.Close();
}
总是出现列名 '单位' 无效,错误就直接指到sda.Fill(ds);这里。不知道怎么回事。其他运行都没错