Using cn As New SqlConnection(strConn) 'Строка подключения
cn.Open()
Dim cmd As SqlCommand
cmd = New SqlCommand(strSQL1, cn)
Dim da1 As New SqlDataAdapter(cmd)
Dim ds1 As New DataSet()
da1.Fill(ds1)
Me.DataGrid1.DataSource = ds1
Me.DataGrid1.DataBind()
cmd.Connection.Close()
cmd.Connection.Dispose()
End Using
|