Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Problem with the SP

Author  Topic 

ramana123
Yak Posting Veteran

57 Posts

Posted - 2005-06-28 : 06:26:24


In my C# code i am calling my Stored Proc using 3 params(2 are input type & one is out param)
the two input params are int32 type and out param is String type in C#.


In My Stored Proc recieving three params as (SQLSERVER)number(10),number(10),varchar
(10).

this stroed procedure returns one varchar value version number like ("1.0" or "3.1")

when i am executing this SP in SQLSERVER its returns value correctly("1.0" or "3.1").
But the Same SP returns always null value to the C# code.Really i am amazing....

can tell me the problem where it is actually..


can you lokk at the code!!!!

in C# code declare on string Array with length 2.getting the Values from the SP into this Array ..
Can you see the Following Code...



try

{

string []versionNo = new string[2];
char[]splitChar = new char[1];
splitChar[0]='.';
IDataParameter[] paramArray = {
dh.CreateParameter("IN_intEntityTypeCode", DbType.Int32),

dh.CreateParameter("IN_intEntityUniqueId", DbType.Int32),
dh.CreateParameter("OUT_strVersion", DbType.String,,ParameterDirection.Output)
};

paramArray[0].Value = (int)entityType;
paramArray[1].Value = entityUniqueId;
paramArray[2].Value = string.Empty ;

dh.ExecuteNonQuery(CommandType.StoredProcedure,"cfg_inventory_max_ver_sel",paramArray);
versionNo = paramArray[2].Value.ToString().Split(splitChar);
if(versionNo.Length == 1)
{
paramArray[2].Value = paramArray[2].Value.ToString()+".0";
}

this is the code.After Execution of ExecuteNonQuery i seen that ParamArray Values through QuickWatch paramArray[2].Value always null string.But SP return in SQLSERVER some version number.
   

- Advertisement -