asp.net C连接oracle数据库并显示数据
asp教程.net c连接oracle数据库教程并显示数据
本款是是由asp.net教程 与oracle数据库连接,并且显示数据中的所有数据哦。
data source=torcl;user id=myusername;password=mypassword;
data source=(description=(address_list=(address=(protocol=tcp)(host=myhost)(port=myport)))(connect_data=(server=dedicated)(service_name=myoraclesid)));user id=myusername;password=mypassword;
oracle客户端
tnsnames.ora
list<per> lp=new list<per> ();
string sql = "select * from man";
try
{
orc.open();
oraclecommand cmd = new oraclecommand(sql, orc);
oracledatareader odr = cmd.executereader();
while(odr.read())
{
per p = new per();
p.id=(int)odr["id"];
p.name=(string)odr["name"];
p.易做图=(string)odr["易做图"];
p.age=(int)odr["age"];
p.address=(string)odr["address"];lp.add(p);
odr.close();
}
return lp;
}
catch (exception e)
{
console.writeline("出错啦!原因是:"+e.message);
return null;
}
finally
{
orc.close();
}
补充:asp.net教程,C语言