Error : “Fill: SelectCommand.Connection property has not been initialized.”

后端 未结 4 1637
鱼传尺愫
鱼传尺愫 2021-02-07 04:58

im getting this error while trying to connect a mysql database to an editor, here is the code behind:

protected void Button1_Click(object sender, EventArgs e)
{
         


        
4条回答
  •  攒了一身酷
    2021-02-07 05:30

    Try This

    MySqlCommand cmd = new MySqlCommand("SELECT tes FROM ins",conn);
    

    or

    MySqlCommand cmd = new MySqlCommand("SELECT tes FROM ins");
    cmd.Connection=conn;
    

提交回复
热议问题