Connecting To Oracle Source
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oracle' list.


Nauman
-- Moved from [aspngstart] to [ngfx-oracle] by Let the good times roll <Click here to reveal e-mail address> --

Dear Friends

I am trying to link my ASP.Net code with Oracle Database 9i. I have worked
with Sql Server but it has some problem with Oracle.
Plz send me the connection code or a sample so that i can solve the problem

Thanks.

Syed Nauman Aqeel
ASP.Net Developer
MagsNet

Reply to this message...
 
    
Daesuin O'Dhonnacahda
Good morning,

Here's our code:

'#### Returns the connection string to be used in this application ####
Friend Function ConnectionStr() As String
Return "Provider=MSDAORA.1;Password=YourPW;User ID=YourUserID;Data Source=YourSource" '#### Microsofts Oracle ODBC driver ####
' Return "Provider=OraOLEDB.Oracle.1;Password=YourPW;User ID=YourUserID;Data Source=YourSource" '#### Oracles ODBC Driver ####
'Return "User ID=YourUserID;Password=YourPW;Data Source=YourSource" '#### Oracles ODP Driver ####
End Function

'#### Make Requested DB Connections ####
Private Function Do_DBConnections(ByVal SQL As String, ByVal strWhichDV As String) As Boolean
Dim blnAnswer As Boolean = False
Dim Connection As New OleDbConnection(ConnectionStr())
Dim Adapter As New OleDbDataAdapter(SQL, Connection)
Dim strResponse As String = ""

Try
Select Case strWhichDV
Case "Tasks"
Adapter.Fill(DataSet, "TBL_Tasks")
Case "GMDOrders"
Adapter.Fill(DataSet, "TBL_GMDOrders")
End Select
Connection.Open()
Select Case strWhichDV
Case "Tasks"
dvTasks.Table = DataSet.Tables("TBL_Tasks")
If (dvTasks.Table.Rows.Count > 0) Then
dvTasks.Table.Clear()
End If
Adapter.Fill(DataSet, "TBL_Tasks")
dvTasks.Table = DataSet.Tables("TBL_Tasks")
dvTasks.Sort = ("TS_IMPLVLNUM, " + mstrTask_SortOrder + mstrTask_IndexDir)
mdTask_MaxRecs = DataSet.Tables("TBL_Tasks").Rows.Count.ToString()
If (mdTask_CurrRecs <= 0) Then mdTask_CurrRecs = 0
Do_SaveSession()
With dbg_Tasks
.DataSource = dvTasks
.AllowSorting = True
.Columns(1).SortExpression = "TS_IMPLVL"
.Columns(2).SortExpression = "NumOf"
.Columns(3).SortExpression = "Dated"
If (.CurrentPageIndex <= 0) Then .CurrentPageIndex = 0
.DataBind()
Dim Xidx As Integer = 0
For Xidx = 0 To (.Items.Count - 1) Step 1
.Items(Xidx).BackColor = System.Drawing.Color.Bisque
.Items(Xidx).Font.Bold = False
Next Xidx
.Items(0).BackColor = System.Drawing.Color.Teal
.Items(0).Font.Bold = True
End With
Case "GMDOrders"
dvGMDOrders.Table = DataSet.Tables("TBL_GMDOrders")
If (dvGMDOrders.Table.Rows.Count > 0) Then
dvGMDOrders.Table.Clear()
End If
Adapter.Fill(DataSet, "TBL_GMDOrders")
dvGMDOrders.Table = DataSet.Tables("TBL_GMDOrders")
dvGMDOrders.Sort = (mstrGMDO_SortOrder + mstrGMDO_IndexDir)
mdGMDO_MaxRecs = DataSet.Tables("TBL_GMDOrders").Rows.Count.ToString()
If (mdGMDO_CurrRecs <= 0) Then mdGMDO_CurrRecs = 0
Do_SaveSession()
With dbg_GMDOrders
.DataSource = dvGMDOrders
.AllowSorting = True
.Columns(1).SortExpression = "OrderTypes"
.Columns(2).SortExpression = "Orders"
If (.CurrentPageIndex <= 0) Then .CurrentPageIndex = 0
.DataBind()
Dim Xidx As Integer = 0
For Xidx = 0 To (.Items.Count - 1) Step 1
.Items(Xidx).BackColor = System.Drawing.Color.Bisque
.Items(Xidx).Font.Bold = False
Next Xidx
.Items(0).BackColor = System.Drawing.Color.Teal
.Items(0).Font.Bold = True
End With
End Select
Connection.Close()
Connection.Dispose()
Adapter.Dispose()
Do_SaveSession()
blnAnswer = True
Catch
strResponse = Err.Description
'#### Show Error Dialog ####

Connection.Close()
Connection.Dispose()
Adapter.Dispose()
blnAnswer = False
End Try
Return blnAnswer
End Function

Hope it helps.

Deasun
----- Original Message -----
From: "Nauman" <Click here to reveal e-mail address>
Date: Tue, 30 Jul 2002 16:46:16 +0500
To: "ngfx-oracle" <Click here to reveal e-mail address>
Subject: [ngfx-oracle] Connecting To Oracle Source

-- Moved from [aspngstart] to [ngfx-oracle] by Let the good times roll <Click here to reveal e-mail address> --

Dear Friends

I am trying to link my ASP.Net code with Oracle Database 9i. I have worked
with Sql Server but it has some problem with Oracle.
Plz send me the connection code or a sample so that i can solve the problem

Thanks.

Syed Nauman Aqeel
ASP.Net Developer
MagsNet
| [ngfx-oracle] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oracle.asp = JOIN/QUIT

--
__________________________________________________________

Sign-up for your own FREE Personalized E-mail at Mail.com

http://www.mail.com/?sr=signup

Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.

http://adfarm.mediaplex.com/ad/ck/990-1736-3566-59

Reply to this message...
 
    
Srinivasa Sivakumar
Try this URL

Using .NET Framework Data Provider for Oracle to Improve .NET Application
Performance
http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotne
t/html/ManProOracPerf.asp

----- Original Message -----
From: "Nauman" <Click here to reveal e-mail address>
To: "ngfx-oracle" <Click here to reveal e-mail address>
Sent: Tuesday, July 30, 2002 6:46 AM
Subject: [ngfx-oracle] Connecting To Oracle Source

> -- Moved from [aspngstart] to [ngfx-oracle] by Let the good times roll
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
 
System.Data.DataSet
System.Data.OleDb.OleDbConnection
System.Data.OleDb.OleDbDataAdapter
System.Drawing.Color
System.Windows.Forms.SortOrder




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com