G
Guest
hI,
i'M TRTYING TO PASS PARAMETER TO A SP.BUT GETTING "OUT OF RANGE ERROR ERROR
FOLLOWING IS THE CODE:
Dim conDG As SqlClient.SqlConnection
Dim cmdDG As SqlClient.SqlCommand
Dim drDG As SqlClient.SqlDataReader
Dim dtDueYear As String
Dim sqldataAdapter1 As SqlClient.SqlDataAdapter
dtDueYear = Trim(txtYear.Text)
' If (IsDate(dtDueYear) = True) Then
conDG = New
SqlClient.SqlConnection("Server=SQLDB;UID=PWD;pwd=;Database=SampleDB")
cmdDG = New SqlClient.SqlCommand("USE testdb EXEC
sp_CrossTabTask
'Task_T','Initial_CH','Initials','Convert(char(3),Due_Date_DT)','DATEPART(YYYY,Due_Date_DT)'", conDG).Parameters(@dDate).Value ' = trim(dtDueYear.text)
where dDate is the parameter I have declared int the Stored procedure.
Thanks in advance..
i'M TRTYING TO PASS PARAMETER TO A SP.BUT GETTING "OUT OF RANGE ERROR ERROR
FOLLOWING IS THE CODE:
Dim conDG As SqlClient.SqlConnection
Dim cmdDG As SqlClient.SqlCommand
Dim drDG As SqlClient.SqlDataReader
Dim dtDueYear As String
Dim sqldataAdapter1 As SqlClient.SqlDataAdapter
dtDueYear = Trim(txtYear.Text)
' If (IsDate(dtDueYear) = True) Then
conDG = New
SqlClient.SqlConnection("Server=SQLDB;UID=PWD;pwd=;Database=SampleDB")
cmdDG = New SqlClient.SqlCommand("USE testdb EXEC
sp_CrossTabTask
'Task_T','Initial_CH','Initials','Convert(char(3),Due_Date_DT)','DATEPART(YYYY,Due_Date_DT)'", conDG).Parameters(@dDate).Value ' = trim(dtDueYear.text)
where dDate is the parameter I have declared int the Stored procedure.
Thanks in advance..