请问谁能给我一个多表查询 并返回字表1.字段名 及表2.字段名的例子。。谢过。。好急-_-" Select ID From TableNameA union Select ID From TableNameB 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 -_-" 多表查询语句这个会。。我问的是怎么在C#中把返回的字段表表现出来像这样dr["字段名"] 可是前面如果多了一个表名。。如a.username 像这样dr["a.username"]根本得不到返回的值我该怎么做??? 给你参考一下:cmd.Connection = connection;cmd.CommandText = "select a.id,b.id from a,b";connection.Open();OracleDataReader reader = cmd.ExcuteReader();if( reader.Read() ){string id_a = reader.GetString(0);int id_b = reader.GetInt32(1);}connection.Close(); Select 'a.'+ID From TableNameA union Select 'b.'+ID From TableNameB 楼上的Union应该是解决问题的好办法,这个问题SQL完全可以解决的。 Replace 问题 如何让一个panel 到顶层? C#中如何在当前网页的文本框插入文本? +++++++问2个.net中的小问题,马上给分! 连接 ACCESS数据库出现了问题 关于C#将16进制转换成ASCii问题 c#删除窗体控件 ******************请问关于在子线程中操作窗体的问题******************* 在ArrayList里,是否有函数可以直接查找某个取值范围内的数的个数? 如何去掉一个组件 DataGrid中根据查询结果用不同颜色查询 XML如何完成节点的添加、修改、删除操作?
cmd.Connection = connection;
cmd.CommandText = "select a.id,b.id from a,b";
connection.Open();
OracleDataReader reader = cmd.ExcuteReader();
if( reader.Read() )
{
string id_a = reader.GetString(0);
int id_b = reader.GetInt32(1);
}
connection.Close();