I'm trying to create some application in vb.net that passing parameter to stored procedure in SQL server 2008 I've tried this code, and I'm not sure what should I write next
Public Function List(ByVal date As Date) As DataTable
Dim SPName As String = "usp_Name"
Dim dt As New DataTable
Try
oConn.Open()
Dim cmdSQL As New SqlCommand(SPName, oConn)
cmdSQL.CommandTimeout = 2000
cmdSQL.CommandType = CommandType.StoredProcedure
cmdSQL.Parameters.Add("@Date").Value = date //im not really sure this is the correct code
Dim da As New SqlDataAdapter(cmdSQL)
da.Fill(dt)
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
oConn.Close()
End Try
Return dt
End Function