Last post Feb 04, 2015 08:48 PM by Fei Han - MSFT
Feb 04, 2015 12:40 AM|Shibly|LINK
I've 6 table in my database called (sysUser, sysProfile, sysRole, tblUser, tblProfile, tblRole) now I want to insert data from (sysUser, sysProfile, sysRole) this table to another 3 tables called (tblUser, tblProfile, tblRole) which have the same field like
the previous 3 tables and all tables in the same database. I am using tier architecture for this operation. Can anyone help me please how can I do that.
Thanks in advance.
Feb 04, 2015 08:48 PM|Fei Han - MSFT|LINK
Thanks for your post.
Firstly, you could query result from the table (sysUser) as below.
var sysu = from u in db.sysUser
where u.userid == uid
Secondly, you could create an instance of “tblUser” and assign value to field, then you could add this “tblUser” instance to your databse.
tblUser tblu = new tblUser();
tblu.UserName = sysu.FirstOrDefault().UserName;
//assign value to other fields