Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Security / October 2007

Tip: Looking for answers? Try searching our database.

How to test a asp connection to mysql?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 20 Oct 2007 23:22 GMT
Have just installed mysql on to my server

Does anyone know of a sample test script that will test if asp can connect
to a test databse?.

I just want to find out if it is working.

thanks
Alexey Smirnov - 25 Oct 2007 19:09 GMT
> Have just installed mysql on to my server
>
[quoted text clipped - 4 lines]
>
> thanks

David, I think you're in the wrong group

MySQL.aspx

<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)

   Dim myConnection  As MySqlConnection
   Dim myDataAdapter As MySqlDataAdapter
   Dim myDataSet     As DataSet

   Dim strSQL        As String
   Dim iRecordCount  As Integer

   myConnection = New MySqlConnection("server=localhost; user
id=15secs; password=password; database=mydatabase; pooling=false;")

   strSQL = "SELECT * FROM mytable;"

   myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
   myDataSet = New Dataset()
   myDataAdapter.Fill(myDataSet, "mytable")

   MySQLDataGrid.DataSource = myDataSet
   MySQLDataGrid.DataBind()

End Sub

</script>

<html>
<head>
<title>Simple MySQL Database Query</title>
</head>
<body>

<form runat="server">

<asp:DataGrid id="MySQLDataGrid" runat="server" />

</form>

</body>
</html>
David - 25 Oct 2007 20:20 GMT
>> Have just installed mysql on to my server

snip

thank you Alexey

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.