mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • _valter_
    New Member
    • Jun 2006
    • 1

    #1

    mysql

    hello all

    I'm trying to make a web page using asp .net using visual basic .net... the code that I'm trying to write is only in vb...

    I have 8 textbox. and I want to insert the text in the textbox into mysql database...

    I have the following code:


    Dim a, b, c, d, ee, f, g, h As String
    Dim conexaoMySQL As MySqlConnection
    Dim daMySQL As MySqlDataAdapte r
    Dim dsMySQL As DataSet
    Dim strSQL As String

    conexaoMySQL = New MySqlConnection ("server=localh ost; user id=root; password=; database=fornec edores")

    a = TextBox1.Text
    b = TextBox2.Text
    c = TextBox3.Text
    d = TextBox4.Text
    ee = TextBox5.Text
    f = TextBox6.Text
    g = TextBox7.Text
    h = TextBox8.Text

    strSQL = "INSERT INTO fornecedores (Nome,Morada,Co dPostal,NC,tele fone,fax,email, pais) VALUES ('a','b','c','d ','ee','f','g', 'h');"

    daMySQL = New MySqlDataAdapte r(strSQL, conexaoMySQL)
    dsMySQL = New DataSet
    daMySQL.Fill(ds MySQL, "fornecedor es"

    this puts the values that are in ""strSQL = "INSERT INTO fornecedores (Nome,Morada,Co dPostal,NC,tele fone,fax,email, pais) VALUES ('a','b','c','d ','ee','f','g', 'h');""" into my database.

    I want to now how to put the values of my variables(ex: a=textbox1.text ) into the code above so that they are inserted into mysql

    sorry for my english

    regards,
    Valter Oliveira
Working...