Welcome to Dream.In.Code
Getting Help is Easy!

Join 99,783 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,525 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



how to use mysqldatabase in asp.net?

 
Reply to this topicStart new topic

how to use mysqldatabase in asp.net?

dushi
post 25 Apr, 2008 - 01:51 PM
Post #1


New D.I.C Head

*
Joined: 23 Feb, 2008
Posts: 37

This one is for access db. I want to know what i have to change to use mysql db. or is there a site that can show me!

CODE

<script runat = "server">
    Sub Page_Load_click()
        Dim dbconn As OleDbConnection
        Dim sql As String
        Dim dbcomm As OleDbCommand
        Dim dbread As OleDbDataReader
        
        dbconn = New OleDbConnection(" Provider= Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Owner\Desktop\db1.mdb;User Id=;Password=; ")

        dbconn.Open()
        sql = "Select * From Name"
        dbcomm = New OleDbCommand(sql, dbconn)
        dbread = dbcomm.ExecuteReader()
        
        Gridview1.Datasource = dbread
        Gridview1.DataBind()
        
        dbread.Close()
        dbconn.Close()
        
    End Sub
</script>
User is offlineProfile CardPM

Go to the top of the page


jayman9
post 25 Apr, 2008 - 03:16 PM
Post #2


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,086



Thanked 14 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


http://www.connectionstrings.com/

Use code.gif tags when posting code.
User is offlineProfile CardPM

Go to the top of the page

Footsie
post 28 Apr, 2008 - 10:08 AM
Post #3


D.I.C Head

Group Icon
Joined: 20 Sep, 2007
Posts: 237



Dream Kudos: 50
My Contributions


You will need to download the MySql connector which is available on their site.

This post has been edited by Footsie: 28 Apr, 2008 - 10:09 AM
User is offlineProfile CardPM

Go to the top of the page

lakhanmahajan
post 8 May, 2008 - 10:21 AM
Post #4


New D.I.C Head

*
Joined: 4 May, 2008
Posts: 20


My Contributions


QUOTE(dushi @ 25 Apr, 2008 - 01:51 PM) *

This one is for access db. I want to know what i have to change to use mysql db. or is there a site that can show me!

CODE

<script runat = "server">
    Sub Page_Load_click()
        Dim dbconn As OleDbConnection
        Dim sql As String
        Dim dbcomm As OleDbCommand
        Dim dbread As OleDbDataReader
        
        dbconn = New OleDbConnection(" Provider= Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Owner\Desktop\db1.mdb;User Id=;Password=; ")

        dbconn.Open()
        sql = "Select * From Name"
        dbcomm = New OleDbCommand(sql, dbconn)
        dbread = dbcomm.ExecuteReader()
        
        Gridview1.Datasource = dbread
        Gridview1.DataBind()
        
        dbread.Close()
        dbconn.Close()
        
    End Sub
</script>


Use this connectin string in the place of y'u connection string
========================
"Data Source=localhost;Initial Catalog=yooffer;Integrated Security=false;Pooling=False;user=user_name;password=password"
===================
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 7/25/08 01:08AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->