01.
string
sqlmaxTypeProductLine =
"SELECT max(id_ProductLine) FROM ProductLine"
;
02.
Com =
new
SqlCommand(sqlmaxTypeProductLine, Conn);
03.
try
04.
{
05.
string
a = Com.ExecuteScalar().ToString();
06.
string
b = a.Substring(0, 2);
07.
string
c = a.Substring(2, 2);
08.
int
d =
int
.Parse(c) + 1;
09.
txtid_TypeProductLine.Text = b + d.ToString(
"00"
);
10.
}
11.
catch
(Exception)
12.
{
13.
txtid_TypeProductLine.Text =
"TT01"
;
14.
}