I have Visual Studio 2003,2005 And 2008.
I work at Visual Basic, In the company they have a Remote server with Oracle 8i.
I have downloaded and installed Oracle for .Net providers 9,10g and 11g without any solutions.
What i need is nomatter how is to connect Visual Studio to open a databse throu an SQL query in oracle to obtain a recordset in a datareader or to execute a SQL without any return.
Any help or onyone experienced on this issue.
The points will be assigned once the conneciton is made.
Thanks in advance for your help
Something like this: Dim oradb As String = "Data Source=Server IP ;User Id=MyId;Password=MyPassword;" Dim con As New Oracle.DataAccess.Client.OracleConnection con.ConnectionString = oradb con.Open()
Data Source isn't the server's ip address, it is the TNS connect string
usually that's the database name
check your oracle home's TNSNAMES.ORA file if you use tnsnames, if you use ldap or onames you'll need to check those (ask your dba) for the connect strings.
Alfredo Luis Torres Serrano
ASKER
The problem is not in the conection string this is not then question focus i have use the tns coneciton string also.
Those strings are over all the internet and there is no need to ask to the DBA, I am the DBA in the company.
I have installed Oracle Development Provider for .Net 10G that is for VS 2005.
Created a reference to the oracle.dataaccess.dll
Create a project when i try to create the object
Dim Conn As Oracle.DataAccess.Client.OracleConnection = New Oracle.DataAccess.Client.OracleConnection
I receive an exception with this stackrace:
en Oracle.DataAccess.Client.OracleConnection..ctor()
en PruebaORa.Form1.Form1_Load(Object sender, EventArgs e) en C:\Documents and Settings\altor\Mis documentos\Visual Studio 2005\Projects\PruebaORa\PruebaORa\Form1.vb:línea 4
en System.EventHandler.Invoke(Object sender, EventArgs e)
en System.Windows.Forms.Form.OnLoad(EventArgs e)
en System.Windows.Forms.Form.OnCreateControl()
en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
en System.Windows.Forms.Control.CreateControl()
en System.Windows.Forms.Control.WmShowWindow(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
en System.Windows.Forms.ContainerControl.WndProc(Message& m)
en System.Windows.Forms.Form.WmShowWindow(Message& m)
en System.Windows.Forms.Form.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
en System.Windows.Forms.Control.SetVisibleCore(Boolean value)
en System.Windows.Forms.Form.SetVisibleCore(Boolean value)
en System.Windows.Forms.Control.set_Visible(Boolean value)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(ApplicationContext context)
en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
en PruebaORa.My.MyApplication.Main(String[] Args) en 17d14f5c-a337-4978-8281-53493378c1071.vb:línea 81
en System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()
If you have the solution please let me know if not i will ask for refund and delete due to no solution.
usually that's the database name
check your oracle home's TNSNAMES.ORA file if you use tnsnames, if you use ldap or onames you'll need to check those (ask your dba) for the connect strings.