方法getRecordFromdatabase()负责查询数据库表Employee并返回一个DataView对象引用。它使用一个名为getEmployee的存储过程来抽象从Employee表中取数据的SQL。这个方法有一个名为p_empid的参数,表示Employee的主键。 PublicFunction getRecordFromdatabase (ByVal p_empid As Int32) As DataView Dim con As OracleConnection = Nothing Dim cmd As OracleCommand = Nothing Dim ds As DataSet = Nothing Try con = getDatabaseConnection( "UserId=scott;Password=tiger;Data Source=testingdb;") cmd = New OracleCommand("Administrator.getEmployee", con) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New OracleParameter("employeeId", OracleDbType.Int64)).Value = p_empid Dim param AsNew OracleParameter("RC1", OracleDbType.RefCursor) cmd.Parameters.Add(param).Direction = ParameterDirection.Output Dim myCommand AsNew OracleDataAdapter(cmd) ds = New DataSet myCommand.Fill(ds) Dim table As DataTable = ds.Tables(0) Dim index As Int32 = table.Rows.Count Return ds.Tables(0).DefaultView |
正在阅读:15秒为ASP.NET应用缓存Oracle数据15秒为ASP.NET应用缓存Oracle数据
2004-02-14 09:34
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键