Users Pricing

forum

home / developersection / forums / linq to sql array list insertion

LINQ to SQL array list insertion

Manoj Bhatt 2416 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?


Manoj Bhatt

Other


1 Answers