Hey C# Corner,
I have the following line:
minDat = new SqlCommand("SELECT * FROM Data WHERE (FileName like '%.html' or FileName like '%.htm') and ocrconvert = 0", cnn).ExecuteReader();
I want to SELECT * FROM Data and TestTable
I want to SELECT * FROM Data and TestTable
So is is possible in that line to make it able to select everything from multiple tables?
Best regards
Best regards
Dhanunjay JajimogglaPosted Oct 24, 2014, 7:43 AM
"SELECT * FROM Data1";
OR
command.CommandText = "SELECT * FROM Data;; SELECT * FROM Data1";
Rasmita DashPosted Oct 24, 2014, 5:42 AM
which will give you (no. of records in Data * no. of records in TestTable) records. which has very limited usage. Instead if you want to get data from these tables you can use union. For union your selected columns of both tables should have same data type.
If I have Table_1 as
& Table_2 as
then I can use
select id, name from Table_1 union select id, name from Table_2
This is what probably you want.