TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
535
2.4k
596.3k
How to use two select query ado.net c#?
Oct 17 2016 10:01 AM
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;
Reply
Answers (
3
)
How to Convert System.Drawings.Bitmap to stdole.IPictureDisp
Visual Studio 2015 crashes on startup...