i) can anyone pl guide me how to connect to oracle databse .. in ASP.NET ..
ii)and i also wanted to get the data in a ADO recordset and fill the Grid with that recordset..
thanx in advance
Printable View
i) can anyone pl guide me how to connect to oracle databse .. in ASP.NET ..
ii)and i also wanted to get the data in a ADO recordset and fill the Grid with that recordset..
thanx in advance
=====================================
1) Connecting to Oracle Database
=====================================
(a) Download and install 'OracleClient' a .Net provider for connecting to oracle
(b) Import System.Data.OracleClient Namespace
(c) Oracle Connection is similar to any other connections
Dim str as String = "Password=tiger;User ID=scott;Data Source=mydb;"
Dim conn as OracleConnection = New OracleConnection(str)
Dim cmd as OracleCommand = New OracleCommand(mySql, conn)
conn.Open()
.....
....
conn.Close()
=====================================
2) Using ADO Recordsets
=====================================
Imports ADODB
Imports System.Data.OleDb
Dim rsFillSource As New ADODB.Recordset
Dim DataTarget As New DataTable("OldADORecordSetData")
rsFillSource.Open("SELECT * FROM SomeTable", "<provider connection string here>", CursorTypeEnum.adOpenForwardOnly)
Try
Dim dbAdapter As New OleDbDataAdapter()
dbAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
dbAdapter.Fill(DataTarget, rsFillSource)
Finally
rsFillSource.Close()
End Try
=====================================
where can you get the .net dataprovider for oracle