Imports System.Data
Imports System.Data.SqlClient
import that namespace and write the following code to some method and change your code According to your Database and Procedure Fields
'Set up Connection object and Connection String for a SQL Client
Using SQLCon As New SqlClient.SqlConnection
SQLCon.ConnectionString = "Data Source=Server;User ID=User;Password=Password;"
SQLCon.Open()
Dim lDataTable As New DataTable
Using SQLCmdAs New SqlCommand()
SQLCmd.CommandText = "GetAuthors" ' Stored Procedure to Call
SQLCmd.CommandType = CommandType.StoredProcedure
SQLCmd.Connection = SQLCon
SQLCmd.Parameters.Add("AuthorName", SqlDbType.VarChar)
Dim daPubs As New SqlDataAdapter
daPubs.SelectCommand = SQLCmd
daPubs.Fill(lDataTable)
End Using
End Using
CheckBoxList1.DataSource = lDataTable;
CheckBoxList1.DataTextField = "Name";
CheckBoxList1.DataValueField = "ID"
CheckBoxList1.DataBind();
Using Stored Procedures in Conjuction with DataAdapter
How to call SQL Server stored procedures in ASP.NET by using Visual Basic .NET