Question
Thread display: Collapse - |
All Answers
Share your knowledge
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
C# SUbstring
string NewCode = string.Empty;
string input = ;
string txtnameEn = input.Substring(0,5);
string strCode = String.Format( "select '{0}' +RIGHT('000'+LTRIM(STR(MAX(Cast(SUBSTRING(code,6,4)as int))+ 1)),4)from horseMaster where code like '{0}0%'",txtnameEn);
DataSet strcode = new DataSet();
DataTable dtCode = DBObj.QueryDB(strCode).Tables[0];
NewCode = dtCode.Rows[0][0].ToString();
return NewCode;
I'm not sure on the string input as i have a lot of txtnameEn. Kindly help!
Regards,
Kai