出现错误未将对象引入到实例上
string strConn = "Data Source=(local);";strConn += "Initial Catalog=FPCOGIS;";
strConn += "user ID=sa;";
strConn += "Password=;";
string strSQL = "select * from tbCoorperationOrg where sCoOrName="+"'"+name+"'";
DataSet moDS = new DataSet();
SqlDataAdapter oAdapter = new SqlDataAdapter(strSQL, strConn);
oAdapter.Fill(moDS, "CoorperationOrg");
moDS.Tables["CoorperationOrg"].PrimaryKey = new DataColumn[] { moDS.Tables["CoorperationOrg"].Columns["iCoOrID"] };
gv.DataSource = moDS.Tables["CoorperationOrg"];
gv.DataBind();
gv为GridView控件,这样写有什么问题,老是提示错误,
提示未将对象引用设置到对象的实例