forum

Home / DeveloperSection / Forums / LINQ to SQL array list insertion

LINQ to SQL array list insertion

Manoj Bhatt 2049 20-Nov-2014

how insert data array to database with linq to sql? 

 DataClassesDataContext db = new DataClassesDataContext();
    simpleTbl tbl = new simpleTbl();
    string[] str =File.ReadAllLines(Server.MapPath("~/str.txt"));
 
    for (int i = 0; i <= 10; i++)
    {
       tbl.Name =str[i];
    }
  db.simpleTbl.InsertOnSubmit(tbl);
    db.SubmitChanges();

but dosen't work

How to do this?


Updated on 20-Nov-2014

Can you answer this question?


Answer

1 Answers

Liked By