If you have will write VB please help me
Private Sub ToolStripButton1_Click (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles ToolStripButton1. Click
SqlConnection1 (conn=New)
SqlConnection1 (ConfigurationManagar ConmnectionString [" ZLConnectionString] "). The Tostring ());
SqlDataAdapter1 da=New SqlDataAdaper1 ();
conn.Open();
Da. SelectCommand1=New SqlCommand ();
Da.SelectCommand1.Com mandText="get_dpxx"
Data. SelectCommand1. The parameters. The Add (" @ dpxx_bh ", SqlDbType. Int). The Value=https://bbs.csdn.net/topics/(TextBox1. Text). The ToString ();
Da.SelectCommand1.Com mandType=CommandType. StoredProcedure;
DataGridView1=da. SelectCommand. ExecuteReader ();
DataGridView1. DataBind ();
conn.Close();
SQLD ()
End Sub
CodePudding user response:
conn.Close();First take a look at it is written in the second window closing event,
CodePudding user response:
Removed, still won't doPrivate Sub ToolStripButton1_Click (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles ToolStripButton1. Click
Try
Me. SqlDataAdapter1. The Fill (Me) ZLDataSet, CType (TextBox1. Text, Integer))
Catch the ex As Exception
System. Windows. Forms. MessageBox. Show (ex. Message)
End the Try