by
2
5
2,432
1
Top 1% !
Famous
Tagged
Refined
OpenSource
Popularity: 7760th place

Published on:

.NETFramework4.0
Architecturex86_64
Extension.cs
LanguageCSharp
LicenseMIT_X11
OSWindows

C#: Read the output parameter of a stored procedure

fetch the output parameter of the given SP and try to read it
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/180261/C---Read-the-output-parameter-of-a-store?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
static public string ReadOutputParam(this SqlCommand sqlCmd, string outputParamName, string defaultValue = "") { object outputValue = defaultValue; if (!string.IsNullOrEmpty(outputParamName)) outputValue = sqlCmd.Parameters[outputParamName].Value; if ((outputValue == null) || (outputValue.Equals(DBNull.Value))) return defaultValue; else return outputValue.ToString(); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus