.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 10th, 2003, 01:40 PM
trueneutral trueneutral is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 21 trueneutral User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 12th, 2003, 04:29 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 44 m 44 sec
Reputation Power: 174
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


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Problems connecting from ASP.net to Oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT