LINQ to SQL array list insertion

Total Post:154

Points:1086

ASP.Net  LINQ  SQL  Array 
 1630  View(s)
Ratings:
Rate this:

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?

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.