public void InsertUserRelData(List <UserRelData> data) { //create new data context var dataSpace = new dataLinqDataContext(); //get needed table from data context var usrTable = dataSpace.GetTable <usersRelTable>(); usersRelTable tbl; //query and parsing here: foreach (UserRelData userdat in data) { Console.WriteLine(userdat.date); tbl = new usersRelTable(userdat.user1ID, userdat.user2ID, userdat.approved, userdat.date, userdat.received); tbl.since = userdat.date; dataSpace.usersRelTables.InsertOnSubmit(tbl); } try { dataSpace.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e); } //Close data context dataSpace.Dispose(); }
partial void DeleteusersRelTable(usersRelTable instance);
partial void UpdateusersRelTable(usersRelTable instance);
partial void InsertusersRelTable(usersRelTable instance);