|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems connecting from ASP.net to Oracle
I have been trying to connect to a Oracle database using ASP.NET. I've been having horrible luck and I can't figure out what my problem is.
Below are my two attempts, I get the same error for both of them. 1st attempt 'get the data day1 = Year(Date.Now()) & "-01-01 00:00:00" Dim sqlConnectionString As String = "Provider=MSDASQL;user id=myID;password=myPassword;data source=PACPRD;Connect Timeout=30" Dim SqlQuery As String = "SELECT D771_HS_EMP_INJURY.PAY_GROUP, D771_HS_EMP_INJURY.DATE_INJURED, D771_HS_EMP_INJURY.BODY_CODE FROM PRDBA.D771_HS_EMP_INJURY D771_HS_EMP_INJURY WHERE (D771_HS_EMP_INJURY.PAY_GROUP='22') AND (D771_HS_EMP_INJURY.DATE_INJURED>={ts '" & day1 & "'}) ORDER BY D771_HS_EMP_INJURY.DATE_INJURED" Dim SqlConnection As New SqlConnection(sqlConnectionString) Dim sqlData As SqlDataReader Dim sqlCommand As New SqlCommand(SqlQuery, SqlConnection) SqlConnection.Open() sqlData = sqlCommand.ExecuteReader() 2nd attempt 'get the data day1 = Year(Date.Now()) & "-01-01 00:00:00" Dim sqlConnectionString As String = "Provider=OraOLEDB.Oracle;user id=myID;password=myPassWord;data source=PACPRD;Connect Timeout=30" Dim SqlQuery As String = "SELECT D771_HS_EMP_INJURY.PAY_GROUP, D771_HS_EMP_INJURY.DATE_INJURED, D771_HS_EMP_INJURY.BODY_CODE FROM PRDBA.D771_HS_EMP_INJURY D771_HS_EMP_INJURY WHERE (D771_HS_EMP_INJURY.PAY_GROUP='22') AND (D771_HS_EMP_INJURY.DATE_INJURED>={ts '" & day1 & "'}) ORDER BY D771_HS_EMP_INJURY.DATE_INJURED" Dim SqlConnection As New OleDb.OleDbConnection(sqlConnectionString) Dim sqlData As OleDb.OleDbDataReader Dim sqlCommand As New OleDb.OleDbCommand(SqlQuery, SqlConnection) SqlConnection.Open() sqlData = sqlCommand.ExecuteReader() Do While sqlData.Read() Here is the error that I get: Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PowIntranet.testVMLChart.SQLPieChart(String sChartTitle, Object& numericValues, Object& textValues, Int32& iNumberOfValues, Boolean isLegend, Int32& Total) in C:\Documents and Settings\jcyatema\VSWebCache\powintranet\Powell\Production\ProductionReports\Qmr\_Test\Charts\VMLCha rt.aspx.vb:616 PowIntranet.testVMLChart.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\jcyatema\VSWebCache\powintranet\Powell\Production\ProductionReports\Qmr\_Test\Charts\VMLCha rt.aspx.vb:138 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +731 If anyone can help I'd be very happy ![]() |
|
#2
|
||||
|
||||
|
Moved to the .NET forum from Beginners
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Problems connecting from ASP.net to Oracle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|