Sub GetData()
Dim ds As New DataSet
Using da As New SqlClient.SqlDataAdapter("rsp_cc_clienttype", objConn)
Dim myComm1 As New SqlCommand("rsp_cc_clienttype", objConn)
myComm1.Parameters.Add("@startdate", SqlDbType.SmallDateTime, 6).Value = sdate
myComm1.Parameters.Add("@enddate", SqlDbType.SmallDateTime, 6).Value = edate
myComm1.CommandType = CommandType.StoredProcedure
da.Fill(ds)
myComm1.ExecuteNonQuery()
'fill clients
With ddClient
.Items.Clear()
.DataSource = ds.Tables(0)
.DataValueField = "clientid"
.DataTextField = "clientname"
.DataBind()
End With
If objConn.State <> ConnectionState.Closed Then
objConn.Close()
End If
'End Try
End Using
End Sub
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Open in new window