使用Visual Studio自带数据库配合SqlDataReader 读取数据库数据
连接语句:
string strConn = "";
SqlConnection myConn = new SqlConnection(strConn);
string strSql = "select * from grxx";
SqlCommand myCommand = new SqlCommand(strSql, myConn);
myConn.Open();
SqlDataReader myReader = myCommand.ExecuteReader();
myGv.DataSource = myReader;
myGv.DataBind();
myReader.Close();