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();
- // DataSet ds = new DataSet();
- 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;

Rajeesh MenothPosted Oct 18, 2016, 12:28 AM
Tapan PatelPosted Oct 17, 2016, 5:07 PM
Midhun TpPosted Oct 17, 2016, 10:50 AM
I think you are just appending two queries one after another without any space or semi colon between them. Just add a blank space before the second query and try it.