Results 1 to 7 of 7
  1. #1
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107

    [help]with databases i guess.

    i guess this is a simple question(for those people who are "warriors" of the vb section)
    lets say i have 2 textboxes and a button, and in one of the textboxes u put "trevor"(or w/e ur name is) and then press the button it will go on your database, and then the other text box shows all the names that have been submitted before so in that text box it would show like.

    trevor
    othername
    othername
    othername

    if u can help thanks if not...well nuthin.

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    You should learn about SQL or MySQL (w/e) queries... (SELECT)
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Download MySQL Connector for .Net (Google).

    Add the .dll from Installed folder\bin\net 2.0 as reference...

    [php] Private conn As New MySqlConnection
    Private Const connstr As String = "server=Your IP;" & "user id=username;" & "password=password;" & "database=database name"
    Private reader As MySqlDataReader[/php]

    [php] Private Sub InsertName()
    Dim strSQL As String = ""

    conn = New MySqlConnection(strConn)
    conn.Open()

    strSQL = "INSERT INTO Table(Column) VALUES('" & Textbox1.text & "')"

    Dim cmd As New MySqlCommand(strSQL, conn)
    cmd.ExecuteNonQuery()

    conn.Close()

    MsgBox("Your name has been added to the database." MsgBoxStyle.Information, "Success")

    Catch ex As MySqlException
    conn.Close()
    End Try

    GetNames()

    End Sub[/php]

    [php]Private Sub GetNames

    Dim strConn As String = connstr
    Dim strSQL As String = "SELECT * FROM Table'"

    conn = New MySqlConnection(strConn)
    conn.Open()

    Dim cmd As New MySqlCommand(strSQL, conn)
    reader = cmd.ExecuteReader

    Do While reader.Read
    Textbox1.Text &= reader("Column") & vbNewLine
    Loop

    reader.Close()
    End Sub[/php]

    Button_Click

    [php]Dim t as new threading.thread(addressof InsertName)
    t.priority = threading.thread.priority.highest
    t.start[/php]


    I just fully wrote this up for you...Feel free to copy & paste...

    Keep in mind that you have to change:

    -Column
    -Table
    -Textbox1.Text



  4. The Following 2 Users Say Thank You to Blubb1337 For This Useful Post:

    cosconub (09-27-2010),trevor206 (09-27-2010)

  5. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Other than giving you code to c&p I advice you to start reading: SQL SELECT Statement and SQL INSERT INTO Statement
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  6. The Following User Says Thank You to 'Bruno For This Useful Post:

    trevor206 (09-27-2010)

  7. #5
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    I wouldn't give him that code AGAIN. =P



  8. #6
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Blubb1337 View Post
    I wouldn't give him that code AGAIN. =P
    I just told him to learn a bit of SQL so it would be easier to understand what you wrote.. xd because i'm pretty sure he is clueless about queries and non-queries ofc i wouldn't rewrite the code.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  9. #7
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Alright, he should...

    INSERT INTO Table(Column,Column) VALUES ('Value','Value')

    SELECT * FROM Table WHERE Column='Value' AND/OR Column='Value'

    UPDATE Table SET Column='Value'

    =P



Similar Threads

  1. [Help Request] Need help with numpad while recording macro !
    By JonathanTBM in forum Vindictus Help
    Replies: 2
    Last Post: 05-10-2011, 07:37 PM
  2. [Help Request] help with ca hacks
    By moises8 in forum Combat Arms Help
    Replies: 4
    Last Post: 05-10-2011, 05:55 PM
  3. [Help Request] Anyone can help with this ?
    By devileyebg in forum Vindictus Help
    Replies: 1
    Last Post: 05-01-2011, 03:57 PM
  4. [Help Request] need help with mod
    By .:MUS1CFR34K:. in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 05-01-2011, 12:40 PM
  5. [Help Request] need help with modding
    By BayBee Alyn in forum Combat Arms Help
    Replies: 0
    Last Post: 04-27-2011, 09:06 PM