The problem i am having is when i am rubbing the code (eithe locally or on the server). When i try to run the code it is breaking everytime i access a stored procedure saying "Could not find stored procedure". I think the reason for this is because within my atabase most of the stored procedures have a schema prefix. (e.g. MySchema.MyStoredProc). Within the code the schema prefix is not added to the start of the procedure name (and this would not be possible to change as there are thousands of calls to stored procs).
What i would like to know, is there any way of adding some code so that the .net code looks uo the Schema prefix?
I have looked online and it says this is possible within SSMS but i canot seem to get it to work and would be a much easier fix if i could chnage it from the .NET code.
Here is my connection string:
Any help on this would be great.
Thanks
Glen RobsonPosted Jul 10, 2012, 6:40 AM
SqlCommand cmd = new SqlCommand("PKG_TEST$PR_GET_ITEST", databaseConnection);
I am not able to go through and change every time the code calls a procedure as there are thousands.
And yes this has just started happening because i changed the authentication to Windows authentication.
Posted Jul 10, 2012, 6:34 AM
1) Are you getting this error after the changing the authentication mode?
2) How you're generating/creating the instance for the command object ? It is single method is returning the command object or each database calls, you're generating the command object.
If it is a single method then,
SQLCommand cmd = new SQLCommand();
cmd.CommandType=COmmandType.Procedure.
if (cmd.CommandType == CommandType.Procedure)
{
cmd.CommandText="yourSchemaName." + ActualSPName;
}