Last post Aug 16, 2011 09:46 PM by Lannie
Aug 16, 2011 04:24 PM|user2980|LINK
I am trying to create a windows application in .net toaccess Oracle database. I have defined my connectionstring in my app.config file.
Now I get the error,
An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
I tried all the provider types in the apge, http://www.connectionstrings.com/oracle.
I have always worked with SQL but now in Oracle, I am not sure why the same thing would not work.
My .net code is,
<add name="DBConnectionString" providerName="OraOLEDB.Oracle"
connectionString="data source=testdb;Integrated Security=true;User ID=test;Password=test;" />
Dim conSettings As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("DBConnectionString")
Dim connectionString As String = conSettings.ConnectionString
Dim myConnection As OleDbConnection = New OleDbConnection(connectionString)
Dim strsql_fn As String = "SELECT first_name FROM dbnames ORDER BY dbms_random.value " & _
"WHERE rownum < 250"
comSelect1 = New OleDbCommand(strsql_fn, myConnection)
myreader1 = comSelect1.ExecuteReadercan somebody please guide me..thank you
Aug 16, 2011 09:46 PM|Lannie|LINK
fix some code errors first, like extra )
"SELECT first_name FROM dbnames ORDER BY dbms_random.value )"
"SELECT first_name FROM dbnames ORDER BY dbms_random.value "
Use exception handling to get more detailed error reporting.