Hello Everyone,
I want to select full data from First query and only select count from Second query. After, I want to get these both query result in to the userList
But, now getting error:- "SQL logic error or missing database
near "select": syntax error
"- string sql = "SELECT * FROM Tble_UserSetUp inner join Tble_Login on Tble_UserSetUp.Id = Tble_Login.UserId WHERE Tble_Login.UserId='" + Userid + "'";
- sql += "select count(*) 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();
-
- try
- {
- using (SQLiteConnection con = new SQLiteConnection(dbConnection))
- {
- using (SQLiteCommand cmd = new SQLiteCommand(sql))
- {
- using (SQLiteDataAdapter da = new SQLiteDataAdapter())
- {
- cmd.Connection = con;
- da.SelectCommand = cmd;
- using (DataSet ds = new DataSet())
- {
- da.Fill(ds);
- dt = ds.Tables[0];
- dt1 = ds.Tables[1];
- }
- }
- }
- con.Close();
- }
-
- var userList = from myRow in dt.AsEnumerable()
- where myRow.Field<bool>("IsActive1") == true
- select myRow;