示例#1
0
        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();
        }
示例#2
0
 partial void DeleteusersTable(usersTable instance);
示例#3
0
 partial void UpdateusersTable(usersTable instance);
示例#4
0
 partial void InsertusersTable(usersTable instance);