I think you are doing things very wrong.first of all, change the above to int Max_Id = 0;string OT = string.empty;string Final_TypeID = string.empty;
To assign your csv files to a variable you can use an array which is done as thus below. string textboxvalues = TexBox1.Text;string[] Final_TypeID = textboxvalues.Split(',');
But I would prefer you trystring textboxvalues = ','+TexBox1.Text;textboxvalues = texboxvalues.replace(',',',OT00');
Then you can pass the value which will be in this format OT0001,OT0002,OT0003,OT0004 to your Stored procedure, and I would advice you use a split csv function to insert the values into your db. Much neater this way, There are many split functions in this forum, do a search.