You should learn about SQL or MySQL (w/e) queries... (SELECT)
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.
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.
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
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.
trevor206 (09-27-2010)
I wouldn't give him that code AGAIN. =P
Light travels faster than sound. That's why most people seem bright until you hear them speak.
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