I attempted to get the records from the MySQL database and display it on a Grid View but nothing appeared. The code is below:
MySqlConnection myconn = new MySqlConnection("server=localhost;user id=root;password=db;database=workers;");
// myconn.Open();
string strSQL = "select * from details";
MySqlDataAdapter mydata = new MySqlDataAdapter(strSQL, myconn);
MySqlCommandBuilder cBuilder = new MySqlCommandBuilder(mydata);
DataSet ds = new DataSet();
mydata.Fill(ds, "details");
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
// myconn.Close();