Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ExecuteReader Error
Message
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
00805298
Message ID:
00805426
Vues:
32
This message has been marked as the solution to the initial question of the thread.
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
    ' Do stuff that can go bad
  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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform