oraclecommand oraclecomd = new oraclecommand(str,oracleconn);
object obj = oraclecomd.executescalar();
if(obj != null)
{
id = convert.toint32(obj);
}
//id = int.parse(oraclecomd.executeoraclescalar().tostring());
#region
// object obj = oraclecomd.executereader();
// if(obj!=null)
// {
// id = convert.toint32(obj);
// }
// if(obj >1)
// {
// id = convert.toint32(obj) + 100;
// }
#endregion
oracleconn.close();
oracleconn.dispose();
//dr1.dispose();
}
catch(exception ex)
{
debug.fail(ex.message +"-"+ ex.stacktrace);
}
return id;
}
这里随你怎么写!无论是要什么值只要在其他表中有关联的字段,就可以获得你想要的数据!
程序写到这里也差不多完了。这是我想到的一种方法!
大家有什么好方法共享写大家一起学习!
多指教!!!