Click here to Skip to main content
15,905,963 members
Home / Discussions / Database
   

Database

 
AnswerRe: Returning a string value from SP Pin
Vimalsoft(Pty) Ltd4-Aug-08 4:16
professionalVimalsoft(Pty) Ltd4-Aug-08 4:16 
GeneralRe: Returning a string value from SP Pin
balaji.t4-Aug-08 19:50
balaji.t4-Aug-08 19:50 
GeneralRe: Returning a string value from SP Pin
Mycroft Holmes4-Aug-08 2:25
professionalMycroft Holmes4-Aug-08 2:25 
GeneralRe: Returning a string value from SP Pin
balaji.t4-Aug-08 2:35
balaji.t4-Aug-08 2:35 
GeneralRe: Returning a string value from SP Pin
balaji.t4-Aug-08 2:38
balaji.t4-Aug-08 2:38 
GeneralRe: Returning a string value from SP Pin
SomeGuyThatIsMe4-Aug-08 3:24
SomeGuyThatIsMe4-Aug-08 3:24 
GeneralRe: Returning a string value from SP Pin
balaji.t4-Aug-08 19:30
balaji.t4-Aug-08 19:30 
GeneralRe: Returning a string value from SP Pin
SomeGuyThatIsMe5-Aug-08 1:50
SomeGuyThatIsMe5-Aug-08 1:50 
well what the output parameter is defined as determines what kind of values it gets out...or if you do a simple

SELECT @varName

at the end of your sp you will be able to get any value from an sp, just remmeber that each SELECT generates a different result set so if you use a reader in c# to read them you'll have to read a value then move to the next result set. I know its not a problem with Sql server i've done this several dozens of times for my applications including a few yesterday(testing things, usually not production code) Sql Server has several problems, rollup doesnt work correctly sometimes, count(*) returns one when it should be 0, a few others, but returning values from a sp is not one of them.

<edit>

i was re reading your posts a second ago, and i've never used this method of retrieving values from anything..

balaji.t wrote:
DC1DataContext obj = new DC1DataContext();
string b = null;
string c = obj.StoredProcedure1(1, ref b).ToString();


i always used SqlCommands and SqlReaders, and opened and closed my own SqlConnections. To be honest i'm not sure how your method actually works..i can guess at the obvious parts, but its entirely possible that your problem is with how you're running the sp and getting your data back, and not with SqlServer. also if you initialize strings with null, you can get null reference exceptions, however if you initialize them with "" you wont get the exceptions, and you'll just have to check b == "" or string.Empty. which works unless you're treating "" as a valid value for something.



Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

AnswerHow many forums have you asked this question on? Pin
Pete O'Hanlon4-Aug-08 9:26
mvePete O'Hanlon4-Aug-08 9:26 
GeneralRe: How many forums have you asked this question on? Pin
balaji.t4-Aug-08 19:27
balaji.t4-Aug-08 19:27 
QuestionGroup by problem Pin
Tauseef A3-Aug-08 17:40
Tauseef A3-Aug-08 17:40 
AnswerRe: Group by problem Pin
Mycroft Holmes3-Aug-08 19:42
professionalMycroft Holmes3-Aug-08 19:42 
QuestionHow to count the number of cases submitted daily weekly quarterly and yearly basis Pin
Rameez Raja3-Aug-08 16:50
Rameez Raja3-Aug-08 16:50 
AnswerRe: How to count the number of cases submitted daily weekly quarterly and yearly basis Pin
Mycroft Holmes3-Aug-08 17:08
professionalMycroft Holmes3-Aug-08 17:08 
AnswerRe: How to count the number of cases submitted daily weekly quarterly and yearly basis Pin
PIEBALDconsult3-Aug-08 17:26
mvePIEBALDconsult3-Aug-08 17:26 
GeneralRe: How to count the number of cases submitted daily weekly quarterly and yearly basis Pin
Rameez Raja3-Aug-08 20:46
Rameez Raja3-Aug-08 20:46 
GeneralRe: How to count the number of cases submitted daily weekly quarterly and yearly basis Pin
Mycroft Holmes4-Aug-08 2:30
professionalMycroft Holmes4-Aug-08 2:30 
QuestionHelp with CONVERT Pin
svanwass3-Aug-08 15:53
svanwass3-Aug-08 15:53 
AnswerRe: Help with CONVERT Pin
SimulationofSai4-Aug-08 2:36
SimulationofSai4-Aug-08 2:36 
GeneralRe: Help with CONVERT Pin
svanwass4-Aug-08 13:23
svanwass4-Aug-08 13:23 
QuestionDisplaying &lt;binary data&gt; Pin
svanwass3-Aug-08 13:50
svanwass3-Aug-08 13:50 
AnswerRe: Displaying &lt;binary data&gt; Pin
Colin Angus Mackay3-Aug-08 13:57
Colin Angus Mackay3-Aug-08 13:57 
GeneralRe: Displaying &lt;binary data&gt; Pin
svanwass3-Aug-08 14:20
svanwass3-Aug-08 14:20 
QuestionSet timezone for Database on remote server Pin
AlexeiXX33-Aug-08 9:33
AlexeiXX33-Aug-08 9:33 
AnswerRe: Set timezone for Database on remote server Pin
Mycroft Holmes3-Aug-08 16:00
professionalMycroft Holmes3-Aug-08 16:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.