Re: vs 2008 c++ access mysql database
Posted by: oz oz
Date: November 06, 2010 04:17PM

here is vb code. i am new for mysql :-)

Imports MySql.Data.MySqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Dim conn As MySqlConnection
Dim da As MySqlDataAdapter
Dim ds As New DataSet

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'connection string
conn = New MySqlConnection("server=localhost;uid=yourusername;pwd=yourpassword; database=test;")
conn.Open()

'Data adapter
da = New MySqlDataAdapter("select * from yourtableintestdatebase", conn)

'Dataset
da.Fill(ds, "yourtable")

'
GridView1.DataSource = ds.Tables("yourtable").DefaultView

GridView1.DataBind()


conn.Close()
End Sub
End Class

Options: ReplyQuote


Subject
Views
Written By
Posted
1131
November 04, 2010 05:29PM
Re: vs 2008 c++ access mysql database
694
November 06, 2010 04:17PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.