Question

Locked

C# SUbstring

By kaithri ·
hi ,

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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums