Protected Sub Page Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
LLoadList()
End If
End Sub
Private Sub LoadList(Getid As Integer)
Dim dtList As New DataTable()
Dim sql As String = "SELECT Col1, Col2, Col3 from Table1 where ColID = @ColID"
Using conn As New SqlConnection(connStr)
Using cmdList As New SqlCommand(sql, conn)
cmdList.Parameters.Add("@ColID", SqlDbType.Int).Value = Getid
Using daList As New SqlDataAdapter(cmdList)
daList.Fill(dtList)
End Using
End Using
End Using
rptList.DataSource = dtList
rptList.DataBind()
End Sub