PC Review


Reply
Thread Tools Rate Thread

Connecting to an oracle 9.2 Database with Visual Studio 2003

 
 
=?Utf-8?B?U0wzM1BZ?=
Guest
Posts: n/a
 
      23rd Nov 2005
Hi,

I have an Oracle database with about 30 tables all relations in order, data
is present in tables that require them.

I'm writing a windows service using vb .NET that polls a set of directories
for new input files (which are flat files in txt). So far so good. The data
contained in those files get parsed into an import entity that can be of the
type 'sample' or 'standard'. Yesterday i noticed that my design was done
rather poorly and decided to form a Business layer and a DAL layer. I created
my business objects (still not all business is already in it).

And now I'm trying to access my databank. I tried accessing it using OLE DB
for Oracle as well as the Oracle connection;

The problem atm is the following. When dragging either OLE DB Connection or
OracleConnection to my DAL component. When I try to create a DataAdapter I
get an errormessage displaying ORA-00162. I haven't got a clue where this
error is comming from.

Yesterday I was trying to connect to OLE DB and then an exception was thrown
(which I read on this forums had something to do with permissions and
read&execute rights on my ORA_HOME directory)

Many thanks in advance
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U0wzM1BZ?=
Guest
Posts: n/a
 
      23rd Nov 2005
I just Undid my code changes and retried and i'm getting the
ex.message "Oracle error occurred, but error message could not be retrieved
from Oracle." String

again.

I'll post the code that goes with it as well:

Private WithEvents selectCommand As System.Data.OleDb.OleDbCommand
Private WithEvents insertCommand As System.Data.OleDb.OleDbCommand
Friend WithEvents updateCommand As System.Data.OleDb.OleDbCommand
Friend WithEvents daStandardMeasurement As
System.Data.OleDb.OleDbDataAdapter
Friend WithEvents SaT04_DataSet1 As ARCDAL.SAT04_DataSet
Private WithEvents connStandardMeasurement As
System.Data.OleDb.OleDbConnection

.....
(within initialise component)
Me.odbcStandardMeasurement.ConnectionString = "Provider=MSDAORA;User
ID=****;Data Source=""TNSNAME.WORLD"";Password=****"
Public Function CreateStandardMeasurement(ByRef stdm As
ARCBLL.StandardMeasurement) As Long
....
Me.odbcStandardMeasurement = New System.Data.OleDb.OleDbConnection
(end initialise component)

Public Function CreateStandardMeasurement(ByRef stdm As
ARCBLL.StandardMeasurement) As Long

daStandardMeasurement.InsertCommand.Parameters.Item(0).Value = stdm.Id
daStandardMeasurement.InsertCommand.Parameters.Item(1).Value =
stdm.StandardId
daStandardMeasurement.InsertCommand.Parameters.Item(2).Value =
stdm.InstrumentId
daStandardMeasurement.InsertCommand.Parameters.Item(3).Value = 0
daStandardMeasurement.InsertCommand.Parameters.Item(4).Value =
stdm.DateMeasured

Try
connStandardMeasurement.Open()
daStandardMeasurement.InsertCommand.ExecuteNonQuery()
stdm.Id = idparam.Value
connStandardMeasurement.Close()
Catch ex As Exception
Debug.WriteLine(ex.Message.ToString())
End Try


End Function

the exception is thrown at connStandardMeasurement.Open()
 
Reply With Quote
 
=?Utf-8?B?U0wzM1BZ?=
Guest
Posts: n/a
 
      23rd Nov 2005
About the ORA-00162 Error:

Quoted from an external site:
Mark,

OracleClient testing confirmed it to be a problem in
System.Data.OracleClient.dll
version 1.0.5000.0. We are working on a fix. In the meantime you can work
around
it by aliasing the server name in tnsnames.ora and choosing an alias that is
16 or less bytes long.

Once again, sorry about this problem

Karol Zadora, VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.

So my TNS Name has to be shorter then 16 chars
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems connecting Visual Studio to MS Access Database M Skabialka Microsoft Access 3 7th Oct 2009 06:57 PM
Hard time connecting to Oracle database from Visual Web Developer 2005 antonyliu2002@yahoo.com Microsoft ASP .NET 0 12th Sep 2006 11:19 PM
Problem Connecting to a database in Visual Studio 2003 GMann Microsoft Dot NET 1 17th Dec 2005 04:29 AM
Visual Studio.NET 02 connecting to ORACLE 9i rel 2 Problem =?Utf-8?B?YWxpc29uc3RhbmcyQHlhaG9vLmNvbQ==?= Microsoft Dot NET Framework Forms 0 25th Oct 2004 09:47 AM
Using Oracle Packages in Visual Studio.NET 2003 designer Holger (David) Wagner Microsoft ADO .NET 0 20th Nov 2003 05:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:50 PM.