- string sql = "SELECT * FROM Tble_UserSetUp inner join Tble_Login on Tble_UserSetUp.Id = Tble_Login.UserId WHERE Tble_Login.UserId='" + Userid + "';select count(*) as docCount from Tble_UserSetUp inner join Tble_Documents on Tble_Documents.UserId = Tble_UserSetUp.Id where Tble_Documents.UserId ='" + Userid + "'";
-
- DataTable dt = new DataTable();
- DataTable dt1 = new DataTable();
-
- da.Fill(ds);
- dt = ds.Tables[0];
- dt1 = ds.Tables[1];
dt is getting all userdetails and dt1 is getting only count.
How can I merge dt1 inside dt? There is UserSetUp model class
contain int type countID, how to assign count value to countID variable
from dt1?
- public partial class UserSetUp
- {
- public Int64 countID { get; set; }
- }
-
- var userList = from myRow in dt.AsEnumerable()
- where myRow.Field<bool>("IsActive1") == true
- select myRow;
- List<Model.UserSetUp> objUserSetUp = userList.Select(m => new Model.UserSetUp()
- {
- Id = m.Field<Int64>("Id"),
- FirstName = m.Field<string>("FirstName"),
- SurName = m.Field<string>("SurName"),
- Computer_Name = m.Field<string>("Computer_Name"),
- IP_Address = m.Field<string>("IP_Address"),
- LogInTime = m.Field<string>("LogInTime"),
- UserName = Decrypt(m.Field<string>("UserName")),
- Password = Decrypt(m.Field<string>("Password")),
- login_Id = m.Field<Int64>("login_Id"),
- UserType = "Documents Scanned",
-
- countID = ? /*How can I assign dt1 value inside this variable?*/
-
- }).ToList();