Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Calling SQL Stored Procedure from C# code


Calling SQL Stored Procedure from C# code

Author
Message
angelinemarren
angelinemarren
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 77
Hi guys,

Looking for some assistance with an MS CRM environment.
Basically there is a stored procedure on the SQL Sever called Aplan.getpenders
The C# code which is run as a job on another server has the following code which I assume is calling the above stored procedure.

var sql = String.IsNullOrEmpty(_p1)
? String.Format("exec GetPenders")
: String.Format("exec GetPenders '{0}'", _p1);

The rest of the code goes on to generate a letter with the information gathered by the sproc.
The problem I am having is that there is something I need to change in the letter that is specified in the Sproc pending certain conditions but no matter what I do it does not seem to reflect the changes in the generated email.

What I have done:
1. Right click sproc, modify, made the changes, parse and execute - when i click on modify again I can see that the changes have been saved - this does not resolve the issue.
2. I rebuilt the C# code on the other server - (just trying everything, not sure if its necessary)

Because the code runs on a different server to the SQL server, I am guessing that the sproc needs to be copied over. The problem is I cannot find the location of the sproc on the SQL server and I cannot find a copy of it on the other server either. Correct me if I am wrong but I need to be looking for a file called GetPenders??? But is it an exe file or an sql file?

I apologise if that sounds confusing but I have very basic SQL knowledge and less again in C# programming so its all a bit of a maze to me.....

Any help or suggestions greately appreciated!!

Thanks

Ange
angelinemarren
angelinemarren
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 77
Got it sorted - lack of knowledge when reading the c# code where it specified the database ..... I was looking at the wrong one!!!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search