Home > Software engineering >  Vb.net kil SQL database process is not effective
Vb.net kil SQL database process is not effective

Time:10-19

Dim strConnection As String="data source=WIN - 8 j5uo9k1uln; Initial catalog=master; Integrated security=SSPI "
Dim sqlConnection1 As New SqlConnection (strConnection)
Dim dataadapters As New SqlDataAdapter
Dim DST As New DataSet
Dim dt As New DataTable
SqlConnection1. The Open () 'Open the database
Dim SQL As String="select spid from sysprocesses where dbid=db_id (' financial management database)"
Dim CMD As SqlCommand=New SqlCommand (SQL, sqlConnection1)
Dataadapters. SelectCommand CMD=
Dataadapters. The Fill (DST, "sysprocesses")
Dt=DST. Tables (" sysprocesses ")
SqlConnection1. Close () 'Close the database
DataGridView1. AutoGenerateColumns=True 'automatically create columns
DataGridView1. The DataSource=dt
Try
Cn=New SqlConnection (" data source=WIN - 8 j5uo9k1uln; Initial catalog=master; Integrated security=SSPI ")
Cn. The Open ()
If DataGridView1. RowCount & gt; 1 Then
A For b=0 To DataGridView1. RowCount - 1
A=DataGridView1. Rows (b) Cells (0) Value. The ToString ()
Cm=New SqlCommand (" kilL '" + a + "' ", cn)
MsgBox (a)
MsgBox (DataGridView1 RowCount)
Next

Cm. ExecuteNonQuery ()

Cn. The Close ()
End the If
Catch the ex As Exception
End the Try
Try
Cn=New SqlConnection (" data source=WIN - 8 j5uo9k1uln; Initial catalog=master; Integrated security=SSPI ")
Cn. The Open ()

Cm=New SqlCommand (" DROP DATABASE "financial management DATABASE, cn)

Cm. ExecuteNonQuery ()

Cn. The Close ()
Catch the ex As Exception
End the Try



'Try
'cn=New SqlConnection (" data source=WIN - 8 j5uo9k1uln; Initial catalog=master; Integrated security=SSPI ")
'cn. The Open ()

'the cm=New SqlCommand (" restore the database from financial management database disk=' E: \ ZiZhu database backup file 'financial management with the replace ", cn)

'the cm. ExecuteNonQuery ()

'cn. The Close ()
'Catch the ex As Exception
'End Try


KILL process part is invalid??????????????????????????????????????????????????????????????????

CodePudding user response:

For a great god
Come and help

CodePudding user response:

The building Lord if change question technique, is estimated to have warrior...
  • Related