1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to connect database using asp.net

Discussion in 'C#' started by DewShare, Feb 12, 2009.

  1. #1
    Hello Experst

    I am new in asp.net. Please tell me how can i connect Mysql and MS Access using Asp.net and How to insert and retrieve data from a table . Please help me I shall be thank full to you :confused:
     
    DewShare, Feb 12, 2009 IP
  2. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #2
    In order to connect to MS ACCESS, you can use OledbConnection and OledbCommand classes. You can get the connection string at connectionstrings.com

    In order to connect to MYSQL, you must have MYSQL driver for asp.net installed. You can download MYSQL Connector Net 5.0 from mysql.com website. Then use MySQLConnection and MySQLCommand classes in MySQL.Data.MySqlClient namespace.
     
    MayurGondaliya, Feb 12, 2009 IP
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    or to make it simpler, just search for it and copy-paste
     
    camjohnson95, Feb 16, 2009 IP
  4. DewShare

    DewShare Well-Known Member

    Messages:
    426
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #4
    I have search alot the code for MS Access connection is available but th code to connect My Sql is not working Please give me working code I shall be thank full
     
    DewShare, Feb 16, 2009 IP
  5. vihutuo

    vihutuo Well-Known Member

    Messages:
    1,511
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #5
    vihutuo, Feb 28, 2009 IP
  6. Sabbir

    Sabbir Banned

    Messages:
    210
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Why don't you use sqlDataSource.. go with that and it will do everything
     
    Sabbir, Feb 28, 2009 IP
  7. riteshmodi

    riteshmodi Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can use OleDbConnection for MySql connectivity .
     
    riteshmodi, Mar 3, 2009 IP
  8. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #8
    MayurGondaliya, Mar 4, 2009 IP