oracle database

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Feb 2008
Posts: 1
Reputation: krunalvarma is an unknown quantity at this point 
Solved Threads: 0
krunalvarma krunalvarma is offline Offline
Newbie Poster

oracle database

 
0
  #1
Feb 11th, 2008
hello all,

can any one teach me how to connect to oracle database
from asp.net in vb 2005

pls reply me with code and example if u can

bye
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: oracle database

 
0
  #2
Feb 11th, 2008
  1. <%@ Page CompilerOptions='/R:"C:\Program Files\Microsoft.NET\OracleClient.Net\System.Data.OracleClient.dll"' Language="vb" %>
  2. <%@ import Namespace="System.Data.OracleClient" %>
  3. <%@ Import Namespace="System.Data" %>
  4. <%@ import Namespace="System.XML" %>
  5. <script runat="server">
  6.  
  7. Sub Page_Load(Sender As Object, E As EventArgs)
  8.  
  9. Dim oOracleConn As OracleConnection = New OracleConnection()
  10. Dim oraODR as System.Data.OracleClient.OracleDataReader
  11. Dim oraConn As System.Data.OracleClient.OracleConnection
  12. Dim oraCMD as System.Data.OracleClient.OracleCommand
  13. Try
  14. oOracleConn.ConnectionString = "User ID=a; Data Source=b; Password=c;"
  15. oOracleConn.Open()
  16. Response.write("Connected to Oracle.")
  17. oraCMD = New System.Data.OracleClient.OracleCommand()
  18. oraCMD.Connection = oOracleConn
  19. oraCMD.CommandText = "SELECT tid, descrption FROM TSTAT;"
  20. oraODR = oraCMD.ExecuteReader()
  21. Catch
  22. Finally
  23. End Try
  24. End Sub
  25. </script>
Last edited by Jx_Man; Feb 11th, 2008 at 7:06 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC