Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Find Stored Procedure

Status
Not open for further replies.

sard0nicpan

Programmer
Dec 28, 2004
57
0
0
US
Ok, I'm not sure whether this is a SQl server question or a VB.Net question, but I'll give it a try here:

Problem: I have a VB.Net program that calls a stored procedure from SQL serv. It works just fine on my computer. After compiling the release version, it still works fine.

However, when I attempt to move the program to another computer with another login, it says "Cannot find stored procedure."

My connection string in VB.net is the following:
Code:
Dim cnn As New SqlClient.SqlConnection
Dim cmd As New SqlClient.SqlCommand
Dim MyDataAdapter As New SqlClient.SqlDataAdapter

            cnn.ConnectionString="Server=WTSqlServ;Database=Imagio;Integrated Security=SSPI"
            cnn.Open()
            
            strCommand = "Exec spGetRevStats"
            '1-CREATE COMMAND TEXT; 2-MAKE COMMAND CONNECTION; 3-OPEN DATA ADAPTER
            cmd.CommandType = strCommand '1
            cmd.Connection = cnn '2
            MyDataAdapter.SelectCommand = cmd '3

            '1-CREATE DATASET; 2-FILL UP THE DATA ADAPTER; 3-FILL UP THE DATAGRID
            grst = New DataSet("BatchHistory") '1
            MyDataAdapter.Fill(grst) '2
            Me.DataGrid1.DataSource = grst.Tables(0) '3

Do I need something more on the connection string? The user I tried to install for has permissions to the db, including permissions to the stored procedures

Any idea what I'm missing?

thanks,

SP
 
Since you are using windows authentication, it could be that you don't not have the appropriate priveleges to run the stored procedure. I would check there first.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
That's the first thing I tried George, all permissions were present.

How about the fact that I'm not the dbo? In Sql Query Analyzer my stored procedures are labelled:

WT\jsmith.spMyStoredProc

Would that make a difference?

SP
 
Nevermind . . .
that was the problem, I had to call by the whole object name:

"Exec [WT\jsmith.spMyStoredProc"

SP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top