public void InsertUserData(List <UserData> data) { //create new data context var dataSpace = new dataLinqDataContext(); //get needed table from data context var usrTable = dataSpace.GetTable <usersTable>(); usersTable tbl; bool online = false; //query and parsing here: foreach (UserData userdat in data) { tbl = new usersTable(userdat.name, userdat.email, userdat.passHash, userdat.gender, userdat.userpic, online, userdat.description); dataSpace.usersTables.InsertOnSubmit(tbl); } try { dataSpace.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e); } //Close data context dataSpace.Dispose(); // throw new NotImplementedException(); }
partial void DeleteusersTable(usersTable instance);
partial void UpdateusersTable(usersTable instance);
partial void InsertusersTable(usersTable instance);