Imports System.Data.SqlClient.SqlConnectionStringBuilder
Imports System.Data.SqlClient
Imports System.Windows.Forms.Form
Imports System.Data
Imports System.Data.DataSet
Imports System.Data.DataColumn
Public Class Class1
Public Function DSObl(ByVal DDlist As Integer) As DataSet
Dim strConn3 As New SqlConnectionStringBuilder()
strConn3.DataSource = ".\SQLExpress"
strConn3.InitialCatalog = "Имя базы"
strConn3.IntegratedSecurity = True
Using cn3 As New SqlConnection(strConn3.ConnectionString)
Dim cmd As New SqlCommand("_spObl", cn3)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@IdCountry", DDlist)
cn3.Open()
Dim daObl As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
daObl.Fill(ds, "Obl")
cmd.Connection.Close()
cmd.Connection.Dispose()
Return ds
End Using
End Function
End Class
|