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. 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.