ExecuteReader: Connection property has not been initialized

前端 未结 7 1486
广开言路
广开言路 2021-01-01 08:29

ExecuteReader: Connection property has not been initialized.

my coding is

protected void Button2_Click(object sender,          


        
7条回答
  •  佛祖请我去吃肉
    2021-01-01 09:15

    You can also write this:

    SqlCommand cmd=new SqlCommand ("insert into time(project,iteration) values (@project, @iteration)", conn);
    cmd.Parameters.AddWithValue("@project",name1.SelectedValue);
    cmd.Parameters.AddWithValue("@iteration",iteration.SelectedValue);
    

提交回复
热议问题