Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Problems with call to stored procedure from .NET

Posted on 2005-05-03
5
Medium Priority
?
268 Views
Last Modified: 2010-04-16
I am calling a stored procedure from my .NET project.  The stored procedure is failing on the table name.  The table exists.  

The following is the Error Message
----------------------------------------------------------------------------------------------------------------------------------
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'PolicyProcedures'.
----------------------------------------------------------------------------------------------------------------------------------

The following is my code
----------------------------------------------------------------------------------------------------------------------------------
CREATE PROCEDURE dbo.uspUpdatePolicy

(@OblID as INT,
@PoliciesProcedures as VARCHAR,
@Summary as VARCHAR,
@Location as VARCHAR,
@p_FunctionalArea as VARCHAR,
@VersionDate as VARCHAR,
@Rating as VARCHAR,
@BusinessUnits as VARCHAR,
@Owner as VARCHAR ,
@Title as VARCHAR

)

AS

BEGIN

INSERT INTO PolicyProcedures

(@PoliciesProcedures,
@Summary,
@Location,
@p_FunctionalArea,
@VersionDate,
@Rating,
@BusinessUnits ,
@Owner ,
@Title)

SELECT    


dbo.v_Policies.PoliciesProceduresID,
dbo.v_Policies.PoliciesProcedures,
dbo.v_Policies.Location,
dbo.v_Policies.p_FunctionalArea,
dbo.v_Policies.VersionDate,
dbo.v_Policies.Rating ,
dbo.v_Policies.BusinessUnits,
dbo.ObligationPolicyMapping.OblID,
dbo.v_Policies.Owner AS Owner


FROM        ( dbo.ObligationPolicyMapping INNER JOIN  dbo.v_Policies ON dbo.ObligationPolicyMapping.PolID = dbo.v_Policies.PoliciesProceduresID)

WHERE     (dbo.ObligationPolicyMapping.OblID = @OblID)

END
GO
0
Comment
Question by:leaddawg24
5 Comments
 
LVL 5

Accepted Solution

by:
ljw87505 earned 180 total points
ID: 13923803
Are you sure it exists in that schema?  I would be tempted to prepend the schema name to the table name just be be paranoid:

INSERT INTO dbo.PolicyProcedures  (or whoever owns it)

Hope this helps

0
 

Author Comment

by:leaddawg24
ID: 13923819
yes, added the schema and same problem....  any other ideas?
0
 
LVL 10

Expert Comment

by:heintalus
ID: 13924108
Try running it within SQL Query analyzer to ensure your stored procedure actually works, then show the .Net code your trying to use to call it.
0
 
LVL 13

Expert Comment

by:dungla
ID: 13924411
make sure that you have PolicyProcedures table in your database
0
 
LVL 9

Expert Comment

by:riyasjef
ID: 13924929
Verify your connection string ... Make sure that database server name is  ok.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question