Hi,
It is a bit hard to figure out what might be wrong without more info on the error. You should wrap whatever this code (or whatever code is calling it) into a Try-Catch-End Try construct. Eg:
Try
Catch ex As Exception
MsgBox(ex.Message)
End try
That way, you will have a sense of where to look for the problem.
Looking at your message/code, I suspect the problem is with permissions (since you said that the sproc works in Query Analyzer and that you made it to the ExecuteReader line). Does the CTORE acct have permission to execute smsg_Get_SendToSystems?
If it doesn't (or you're not sure), run the following in Query Analyzer:
GRANT EXEC ON smsg_Get_SendToSystems TO CTORE
HTH,
John Barone
>I'm trying to run the following code from a button on a winform in vb.net, but I keep getting an error (Unhandled exception) on the ExectuteReader() line (last line).
>
>
>Thanks for any help
>
>
> Dim strConnect As String
> Dim strCommandText As String
> '
> strConnect = "SERVER=(local);database=CTORE;UID=ctore;pwd=cqi$$"
> strCommandText = "smsg_Get_SendToSystems"
>
> Dim objConnect As New SqlClient.SqlConnection(strConnect)
> objConnect.Open()
> Dim objCommand As New SqlClient.SqlCommand(strCommandText, objConnect)
> objCommand.CommandType = CommandType.StoredProcedure
>
> Dim objDataReader As SqlClient.SqlDataReader
>
> objDataReader = objCommand.ExecuteReader()
>
>
>I have tried calling the stored procedure from the QA, it returns two records.