Click here to Skip to main content
16,008,075 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hai,

How to insert the Arraylist Value in the Database Table using c#.
I am using SqlServer2005.
Posted

 
Share this answer
 
C#
for(int k=0;k<array.count;k++)>
{
 cn.Open();
            cmd = new SqlCommand("insert into tbl values('"+array[k]+"')",cn);
            cmd.ExecuteNonQuery();
            MessageBox.Show("inserted successfully!!!");

            cn.Close();
}
 
Share this answer
 
v4
Comments
RaisKazi 26-Nov-11 8:00am    
Edited: Added "pre" tag.

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