Join table?

  • Thread starter Thread starter LL
  • Start date Start date
L

LL

Hi,

My sql join two table, how to call the fill method? thanks.

string sqlStr = "select * from table1, table2";

SqlDataAdapter myCommand = new SqlDataAdapter(sqlStr, myConnection);DataSet
ds = new DataSet();

myCommand.Fill(ds, ?);
 
If I recall correctly, your "?" can be any string, which will represent the
table created from the merge ( BTW a join is something else again ) of the
two tables. So if for example you had
Table1:
integer
1
2
3
4
and Table 2:
integer2
5
6
7
8

and you called myCommand.Fill( ds, "mergedTable" );

you would have the following table inside the dataset ds

ds.Tables["mergedTable"]
integer integer2
------------------
1 | 5
2 | 6
3. | 7
4 | 8

Of course I haven't worked with the Data Provider in a while but this is
what I would expect to occur.
 
Back
Top