Re: IDbCommand, Oracle, Select query



On 28 Dec 2006 04:24:14 -0800, Magnus Flisberg wrote:

Best programmer,

My mission is to execute a sql statement in vb.net and retrive the data
into a file. I have managed to detect som issues with my code:

queryString = "SELECT ...."

connectionString = "server=OraOLEDB.Oracle;User
id=x;password=x;Data source=x;"

Using connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(queryString, connection)
Try
connection.Open()
Catch ex As Exception
If log.IsErrorEnabled Then log.Error(ex.Message)
End Try
Dim reader As SqlDataReader = command.ExecuteReader()

Try
While reader.Read()
writer.WriteLine(String.Format("{0}, {1}",
reader(0), reader(1)))
End While
Finally
reader.Close()
End Try
End Using

Error at connection.Open():

"An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)"

this link : http://support.microsoft.com/kb/914277 is about how to
solve this my accepting remove access. But I think this is another
problem? I have no problem with my connectionstring...

I am running a oracle server with a database I am trying to access.

Any idea how I can reach my oracle db and get my information?

Regards,
Magnus

If you're connecting to an oracle database i suggest you look at the
OracleConnection, OracleCommand and the OracleDataReader classes. Those
would be the ideal classes to use for data access from an Oracle database
--
Bits.Bytes
http://bytes.thinkersroom.com
.



Relevant Pages

  • Re: I cant find a SETUP.EXE in the SQL Plus Client ??
    ... someone else's server for testing some SELECT statements I'm ... free client because I don't own the Oracle license. ... SQL statements. ... There is no documentation with that download. ...
    (comp.databases.oracle.tools)
  • Re: Connection issues between .Net framwok and SQl Express 2005
    ... You will no longer need the database MDF file name in the connection string. ... simply attach the ASPNETDB.mdf to SQL Server permenantly, ... as USER INSTANCE on existing SQL Server Express, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: I cant find a SETUP.EXE in the SQL Plus Client ??
    ... someone else's server for testing some SELECT statements I'm writing for them. ... How do I get a free Oracle client installed, if possible, so I can test some SQL statements. ... There is no documentation with that download. ...
    (comp.databases.oracle.tools)
  • Re: Performance of ODBC
    ... if you have a software firewall; forward 1433/1434 to your server ... I've now created my own server with SQL Server 2005 Express, ... glitch concerns the Upsizing Wizard. ... I originally set up my ODBC connection via ...
    (microsoft.public.access.adp.sqlserver)
  • Re: I cant find a SETUP.EXE in the SQL Plus Client ??
    ... someone else's server for testing some SELECT statements I'm writing ... How do I get a free Oracle ... client installed, if possible, so I can test some SQL statements. ... There is no documentation with that download. ...
    (comp.databases.oracle.tools)