How to Connect Oracle 10g with connection String and SqlDataSource

I want to connect Oracle Database 10g with SQLDataSource to select, update and insert the data and whats the connection string to connect Oracle Database with ASP.net, oledb, Microsoft ODBC or ASP.net ADO

 

0
riyaz_din
2/5/2009 10:52:54 AM
asp.net.oracle 2269 articles. 0 followers. Follow

4 Replies
2601 Views

Similar Articles

[PageSpeed] 28

-1
Mike
2/6/2009 9:45:03 PM

Hi Dear, i am also looking for answer of same question.


Regards,

Avinash

Please don't forget to click "Mark as Answer" on the post that helped you.
0
avinash_vns
4/22/2009 9:18:49 AM

Refer to this

Sub OracleDbList_SelectedIndexChanged(sender As Object, e As EventArgs)
If OracleDbList.SelectedIndex <> -1 Then

Dim db As String = OracleDbList.SelectedItem.Text

' substitute <userid> and <password> with your DB user id and password respectively

Dim myConnString As String = "Provider=MSDAORA;Data Source=" + db + ";Database=" + db + ";User Id=" + <userid> + ";Password=" + <password>
Dim myConn As New OleDbConnection(myConnString)
Dim mySelectText As String = "SELECT table_name FROM all_tables"

Dim myDA As New OleDbDataAdapter(mySelectText, myConn)
Dim myDS As New DataSet()

myDA.Fill(myDS, "all_tables")

OracleTableGrid.DataSource = myDS.Tables(0)
OracleTableGrid.DataBind()
OracleTableGrid.Visible = True
End If
End Sub


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
0
wmec
4/22/2009 10:12:00 AM

Hi,

I have got the solution,

1) First you download this dll "system.data.oracleclient.dll" and add reference in your solution.

2)  add this key in your web.config

<add name="Conn" connectionString="Data Source =(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yuorhostip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=yourservicename)));User Id=youruserid;password=yourpassword;"></add>

3) and code will be like this

Imports System.Data

Imports System.Data.OracleClient

Partial Class _Default

Inherits System.Web.UI.Page

Dim Conn As New OracleConnection Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load

Dim str As String

Dim ds As New DataSet

str = "select * from temp_blob"

Conn.ConnectionString = ConfigurationManager.ConnectionStrings("Conn").ToString()

ds = GetDetails(str)

grd.DataSource = ds

grd.DataBind()

End Sub

Public Function GetDetails(ByVal str As String) As DataSet

Dim ds As New DataSet

Dim myCmd As New OracleCommand

myCmd.Connection = Conn

myCmd.CommandText = str

myCmd.CommandType = CommandType.Text

Dim sda As New OracleDataAdapter

sda.SelectCommand = myCmd

Conn.Open()

sda.Fill(ds)

Conn.Close()

myCmd.Dispose()

Return ds

End Function

End Class

)

 


Regards,

Avinash

Please don't forget to click "Mark as Answer" on the post that helped you.
0
avinash_vns
4/24/2009 7:34:29 AM
Reply:

Similar Artilces:

what options of connection string should i use to connect to oracle
hiI was trying to connect to my oracle server. I am getting the error using System; using System.Data.OracleClient; namespace DataAccess {         {            public DBconnect()             {                      OracleConnection oOracleConn = new OracleConnection();             &...

Slow connection to Oracle 10g connection cache
Hi, First: by slow I mean around 250 milliseconds, not whole seconds or minutes. PB 10.2.0 7516 EAServer 5.3 53016 Oracle Instant client I have an Oracle 10g database that I set up a connection cache for in EAServer. I am connecting to it from a PowerBuilder component with the following code: sqlca.DBMS = as_dbms If Len(as_cachename) > 0 Then sqlca.DBParm = "UseContextObject='Yes',CacheName='" + as_cachename + "'" If Len(as_dbparm) > 0 Then sqlca.DBParm += "," + as_dbparm End If End If CONNECT; I have the c...

Oracle::DBI module
Hello, Can someone help with me a DBI issue I'm having in connecting to an Oracle 10g DB server? We have production scripts that loads data into DB (oracle9i) using DBI module. We recently migrated our database to oracle 10g. Our DBA has implemented load balancing on this 10g server and gave us the new tnsnames entry as... hoststring.10G = (DESCRIPTION= (LOAD_BALANCE=yes) (ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.123)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.124)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=xxxx) ) ) Currently, using the...

Oracle 10g Express installed prevents PB from connecting to Oracle 8i
Problem with PB 9 and connecting to Oracle 8i database. After installing oracle 10g Express on my machine (server and client), I can no longer connect to Oracle 8i FROM PB. I CAN connect using Oracle tools (Net8 assistant) and using TOAD. The TNS etc. did not change. I removed the Oracle 10g Express bin from my PATH, and now I can connect. Question is why 10g Express stops PB from connecting but not TOAD/Oracle 8i Net8 assistant. I understand Oracle express is doing something different to prevent people from running multiple instances, but why does this only affect PB? I ...

connection string for Oracle database c# dot net
how to connect the oracle database from the asp.net C# code.. thanks in advance for your guidance.. Hi, take a look at: http://www.connectionstrings.com/?carrier=oracle. Grz, Kris.Read my blog. Handy Firefox plugins for web developers. it was useful. thanks a lot.....

How to pass oracle connection string to crystal report in .net
hi all i am using reportdocument  class  of crystal report i have oracle connection string , i need to pass this connection dtring to reportdocument  ...   regards rajesh         Actually there is no need to set seperate connectionstring for crystal report, in your case you fetch some records from DB and fill into the Dataset afterwards you just pass the DataSet.Tables[0] into DataSource property of the crystal report.If this post is answer of your question then don't forgot to Click Mark As Answer...

Setup ODBC connection to Oracle 10g RAC Instance using Oracle Wire Protocal
How do I configure Oracle Wire Protocol ODBC Driver to connect to an Oracle RAC 10G instance. The current odbc driver version is 4.20.00.81 The v4.2 driver does not have support for Oracle 10g features. You can use this driver to connect to an Oracle 10g server, but you won't be able to use any Oracle 10g features such as RAC or the new data types in Oracle 10g. -- Reg Domaratzki, Sybase iAnywhere Solutions Sybase Certified Professional - Sybase ASA Developer Version 8 Please reply only to the newsgroup iAnywhere Developer Community : http://www.ianywhere.com/developer ...

Problem in creating Oracle connection cache using EAServer 5.0,Oracle 10g
This is a multi-part message in MIME format. ---=_forums-2-dub417ced02 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit I am facing problem to create connection cache using Oracle.I am attaching snapshot of EAServer properties which I set. I refered query dt. 21 jul,04 topic "EAServer JDBC connection to Oracle". But it not works. ---=_forums-2-dub417ced02 Content-Type: application/x-zip-compressed; name="Oracle connection cache problem.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=&q...

Problems connecting to Oracle 9i database with Oracle 10g Client and Win XP x64
Hardware/Software:Dell Precision 490 with Intel Xeon 64 bit processor running MS Windows XP Professional x64 Edition Version 2003 Service Pack 1.Visual Studio .NET 2005 Oracle 10g ClientI am trying to run my ASP.NET application from the above mentioned computer that connects to an Oracle 9i database on another machine on the network, but get the following error when using the OLEDB provider for Oracle:Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation.Provid...

Can't connect to Oracle using Oracle 10g Client in Windows 2003 Enterprise
Hi, My test environment is Windows 2003 Enterprise with Oracle 10g Client and IIS installed. I wrote a simple asp.net page to connect to an Oracle database and display a query result in a datagrid. But can't connect to oracle. It seems that .NET can't find an oracle client. I was wondering if I miss some steps to configure .NET framework or something. Any idea is highly appreciated. Thanks in advance. Joey Do you have ASPNET user account is added to the Oracle software installed folders/subfolders? If not please add and restart the box and see, that could solve your proble...

Checking the status oracle connection PB9.0 Oracle 9i(9.2.0.50) Lost connection problem (LAN and WAN)
Cheers to all. We want to know if there is a way to get the status of the connection with oracle databse (online way), we use native driver for Oracle9i. Some times we get some lan and wan problems that produce small lost connection in seconds, but we dont any action that describe the success problem. we need to put some code in the application that help us to know the exactly moment when these happen to take some decision something loke a monitor tool. we appreciate any suggestions. Thanks in advance Eduardo Primera from: Venezuela ...

Can't connect to Oracle database using Oracle 10g Client in Windows 2003 Enterprise
Hi, Our test environment is Windows 2003 enterprise with IIS and Oracle 10g client installed. I wrote a simple asp.net program to connect to a Oracle database and display the select result in a datagrid. But can't connect to Oracle. It seems .NET can't find the oracle client. Any idea is highly appreciated. Thanks in advance. Joey...

oracle connection string
hi i am using vs2005 and oracle10g in my project.i have to insert data from gui to backend.can any one help me in writing connection string to this connection.i am new to this field.i dont know how to write command and conn string. Thanks in advance Go here:  http://www.connectionstrings.com/Steve Wellens My blog i am using vs2005 and oracle10g in my project.i have to insert data from gui to backend.can any one help me in writing connection string to this connection.i am new to this field.i dont know how to write command and conn string.  ConnectionString="provider=m...

Connect to Oracle 10g
Hi, this is a problem using PB 10.5.2 7611 on a Windows Server 2003 x64 Edition connecting to an Oracle 10.2.0.4.0 database. I can connect without problems using SQL Plus. Even if I create an ODBC datasource the "Test connection" function works ok. But when I try to connect using PB I get: "ORA-12154: TNS: Angegebener Connect Identifier konnte nicht aufgel�st werden", that is "Could not resolve the connect identifier specified". What is the problem here? TIA, Chris Werner f+s software gmbh Chris, I'm no PB expert, but a possible explan...

Web resources about - How to Connect Oracle 10g with connection String and SqlDataSource - asp.net.oracle

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Using The LINQDataSource
-*+There is a new datasource control available in Visual Studio that works in much the same way as the SQLDataSource and the ObjectDataSource. ...

Gabriel Mongeon
Archive - Gabriel Mongeon

moredotnet
M ore d otnet .NET Interview Questions, ASP.NET, C#, VB.NET, XML, SQL Check Out http://www.dotnetUncle.com √ .NET NOTES OOPS in .NET .NET ...

Architectural Overview of the Windows Presentation Foundation Beta 1 Release
Introduction Windows Presentation Foundation Beta 1 Windows Integration New Features WinFX SDK Exploring the New Features Introducing "Express" ...

About Mikesdotnetting
I started this site as somewhere to store answers to bits and pieces that I see asked frequently in the forums at www.asp.net . Rather than type ...

Using MiniProfiler with SqlDataSource ASP.NET WebForms Control
public class ProfiledSqlDataSource : SqlDataSource{ protected override DbProviderFactory GetDbProviderFactory() { // get the "base" DbProviderFactory ...

ASP.NET Pivot Table - RadPivotGrid for ASP.NET AJAX
... reports. RadPivotGrid allows easy customization of all data reports. Try now! Use any declarative data source control (AccessDataSource, SqlDataSource, ...

Sign on
Sign On • Join • Forums Home User Name * Password * Remember me next time ( I forgot my password ) SUBMIT YOUR WTF Content Random Article All ...

ComboBox Sample
ComboBox is an ASP.NET AJAX control that, like the AutoCompleteExtender , combines the flexibility of a TextBox with a list of options that users ...

Resources last updated: 12/19/2015 1:48:41 PM