G
garak
Hi,
I store an SQL Result with two tables in my DATASET.
Now I want to access the fields int_width which existin both tables.
I only found the solution shown below.
Is there a solution where I can use the name of the Database tabel
and the fieldname ([database table].fieldname)
e.g. tbl_Root_Rooms.intWidth ?
I tried but it didn’t work…
My code so far:
---------------
String Query =
String.Format ("SELECT * FROM tbl_Root_Rooms INNER JOIN
tbl_Root_Objects ON tbl_Root_Rooms.REF_ID_ObjectWall_H
tbl_Root_Objects.ID_Root_Object WHERE STR_RoomName = '{0}'",
RoomName)
DataSet DS_RRoom = PMain.myPDbAccess.QueryDb (Query, "RRoom");
RoomWidth = (int) DS_RRoom.Tables["RRoom"].Rows[0]["int_Width"];
ObjectWidth = (int) DS_RRoom.Tables["RRoom"].Rows[0]["int_Width1"];
I store an SQL Result with two tables in my DATASET.
Now I want to access the fields int_width which existin both tables.
I only found the solution shown below.
Is there a solution where I can use the name of the Database tabel
and the fieldname ([database table].fieldname)
e.g. tbl_Root_Rooms.intWidth ?
I tried but it didn’t work…
My code so far:
---------------
String Query =
String.Format ("SELECT * FROM tbl_Root_Rooms INNER JOIN
tbl_Root_Objects ON tbl_Root_Rooms.REF_ID_ObjectWall_H
tbl_Root_Objects.ID_Root_Object WHERE STR_RoomName = '{0}'",
RoomName)
DataSet DS_RRoom = PMain.myPDbAccess.QueryDb (Query, "RRoom");
RoomWidth = (int) DS_RRoom.Tables["RRoom"].Rows[0]["int_Width"];
ObjectWidth = (int) DS_RRoom.Tables["RRoom"].Rows[0]["int_Width1"];