| | |
MySQL - ASP.NET - Issues....
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Solved Threads: 0
I'm trying to get started in ASP.NET, but I just don't understand the errors being returned to me. I'm trying to connect to my MySQL database. I have followed several examples from books and the internet with no success. Could someone look at my code and see if I'm screwing something up?
Also, how do you use the ****.vb file? I'm using VS.NET as my editor and if you hit F7 you can go to the ****.vb file, but if I place code in the Page_Load event it never runs..... ????
Any clues?????
Thanks in advance
- Eric
VB.NET Syntax (Toggle Plain Text)
<%@ Import Namespace="System.Data.OleDB" %> <%@ Import Namespace="System.Data" %> <%@ Page Language="vb" AutoEventWireup="false" Codebehind="default_page.aspx.vb" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <% 'Put user code to initialize the page here Dim dr As System.Data.OleDb.OleDbDataReader Dim cn As System.Data.OleDb.OleDbConnection Dim cmd As System.Data.OleDb.OleDbCommand Dim cs As String Dim SQL As String cs = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=cashwell.no-ip.info;" & _ "DATABASE=Saphyre;" & _ "UID=WebTest;" & _ "Jet OLEDBatabase PASSWORD=asp-net;" & _ "OPTION=16427" cn = New OleDbConnection(cs) cn.Open() SQL = "SELECT name FROM tbl_hosp;" cmd = New OleDbCommand(SQL) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) %> <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR"> <meta content="Visual Basic 7.0" name="CODE_LANGUAGE"> <meta content="JavaScript" name="vs_defaultClientScript"> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"> <meta content="VisualStudio.HTML" name="ProgId"> <meta content="Microsoft Visual Studio.NET 7.0" name="Originator"> </HEAD> <body MS_POSITIONING="GridLayout"> <% Response.Write(dr.GetString(0)) %> </body> </HTML>
Also, how do you use the ****.vb file? I'm using VS.NET as my editor and if you hit F7 you can go to the ****.vb file, but if I place code in the Page_Load event it never runs..... ????
Any clues?????
Thanks in advance
- Eric
Try changing this line: cmd = New OleDbCommand(SQL) to this:
Also, your Page_Load event probably isn't working, because it's not wired up. Is there a 'Handles Page.Load' at the end of the declaration line?
VB.NET Syntax (Toggle Plain Text)
cmd = New OleDbCommand(SQL,cn)
Also, your Page_Load event probably isn't working, because it's not wired up. Is there a 'Handles Page.Load' at the end of the declaration line?
-Ryan Hoffman
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Solved Threads: 0
I placed the connection object in the parameter as you instructed. I'm now getting a new error, "Could not find installable ISAM."
You can see the error at this address: http://www.derivetech.us/default_page.aspx
Any thoughts?
****.vb:
I did a search and could not find anywhere.
- Eric
You can see the error at this address: http://www.derivetech.us/default_page.aspx
Any thoughts?
****.vb:
I did a search and could not find
•
•
•
•
Handles Page.Load
- Eric
![]() |
Similar Threads
- Looking for Sr. ASP .NET Developers (Software Development Job Offers)
- ASP.Net perm full time programmer wanted (Web Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- Experience ASP.net with C# developer needed!! (Web Development Job Offers)
- ASP.NET with MySQL (ASP.NET)
- ASP.Net / C# Web Developer (Web Development Job Offers)
Other Threads in the VB.NET Forum
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account add application array basic beginner browser button buttons center check click code combo cpu crystalreport cuesent database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade file-dialog filter forms ftp generatetags html images input insert intel listview mobile module monitor mysql net number open output panel passingparameters picturebox picturebox2 port print printing printpreview problem regex reuse right-to-left searchvb.net select settings shutdown socket sqldatbase sqlserver storedprocedure survey tcp temperature textbox timespan transparency trim txttoxmlconverter user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





