PDA

Click to See Complete Forum and Search --> : 2 Questions ..[Resolved]


Kunchesm
Oct 29th, 2002, 12:13 PM
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

Kunchesm
Oct 30th, 2002, 01:18 PM
=====================================
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

=====================================

robdotnet00
Nov 4th, 2002, 03:14 PM
where can you get the .net dataprovider for oracle

Kunchesm
Nov 5th, 2002, 01:26 PM
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/MSDN-FILES/027/001/940/msdncompositedoc.xml