Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have the store procedure and i have passed the value as output which will return the value as string but the string is showing only length of 1 but on store procedure i have set the length(max) but the output is still single
eg the output should be mr-01-1 but only showing m

the store procedure is called as
XML
SqlParameter[] param1 = new SqlParameter[1];

           var a = string.Empty;

           List<Object> objParamDetails = new List<Object>();

           SqlParameter MemberId = new SqlParameter("@MemberId", a);
           MemberId.Direction = ParameterDirection.Output;
           param1[0] = MemberId;



DataTable dt1 = new DataTable();
dt1 = CDataAccessLayer.GetDataTable("sp_5_43_GetCashReceivedPrint", param1, string.Empty, ref objParamDetails);
Posted
Updated 30-Jul-14 20:52pm
v2

1 solution

You need to mention the size of the string while you are defining the parameter

C#
SqlParameter MemberId = new SqlParameter("@MemberId", System.Data.SqlDbType.VarChar,10,a);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900