BP Forums
MySql Help - Printable Version

+- BP Forums (https://bpforums.info)
+-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55)
+--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56)
+---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8)
+----- Forum: Programming Help (https://bpforums.info/forumdisplay.php?fid=9)
+----- Thread: MySql Help (/showthread.php?tid=507)



MySql Help - Blackrobot - 04-05-2012

[Image: e7pl-3v-42a0.jpg]
Hello Guys,
i need some help with my programm and sry for my Bad English.
I want to connect the program with a MySQL database
Description to the picture:

1. "Anwesend" mean something like Online:
- The Nickname of T1 -> Add to L1.
- The nickname may only be in the list 1 time.

2. "Abwesend" mean something like Offline:
- The Nickname of T1 -> Remove from L1.

3. "Entfernen" mean something like Remove:
- The selected nickname from L1 -> Remove from L1.

4. "Leeren" mean something like Clear:
- Clear L1.

5. "Go Team!" :
- The first nickname from L1 -> Add to L2 -> and Remove from L1.

6. "Leeren" mean something like Clear:
- Clear L2.

7. "Ersetzen" mean something like Replace:
- The selected nickname from L2 -> Remove from L2 -> Add the frist nickname from L1.

8. Is like 5, 6, 7 only with L3

The File: <!-- m --><a class="postlink" href="http://www.mediafire.com/?zuqa73445x4m3x0">http://www.mediafire.com/?zuqa73445x4m3x0</a><!-- m -->

I hope you can help me, despite my poor English <!-- sSad --><img src="{SMILIES_PATH}/icon_e_sad.gif" alt="Sad" title="Sad" /><!-- sSad --> .


Re: MySql Help - brandonio21 - 04-05-2012

Hello Blackrobot,

In order for us to help you, we need an actual description of what you are trying to do.....

Side Note: CS! Wooo!


Re: MySql Help - Blackrobot - 04-06-2012

[Image: e7pl-3w-3988.jpg]
I do not know what to do...


Re: MySql Help - xolara - 04-06-2012

If you are trying to make something similar to a register you can try out the code i use

Code:
Private Sub MySqlRegister(ByVal username As String, ByVal password As String)
        Try
            MySqlConnection = New MySqlConnection
            MySqlConnection.ConnectionString = "server=" & Host & ";Port=" & Port & ";User id=" & User & ";Password=" & Pass & ";database=" & Database
            MySqlConnection.Open()
            Dim MySqlAdapter As New MySqlDataAdapter
            Dim SqlQuery = "SELECT * FROM testing WHERE username='" & username & "'"
            Dim Command As New MySqlCommand
            Dim MyData As MySqlDataReader
            Dim RegisterFinal As New MySqlDataAdapter

            Command.Connection = MySqlConnection
            Command.CommandText = SqlQuery
            MySqlAdapter.SelectCommand = Command
            MyData = Command.ExecuteReader

            If MyData.HasRows = 0 Then

                MySqlConnection.Close()
                MySqlConnection.Open()

                SqlQuery = "INSERT INTO testing (username, password) VALUE('" & username & "','" & password & "')"
                Command.Connection = MySqlConnection
                Command.CommandText = SqlQuery
                RegisterFinal.SelectCommand = Command
                MyData = Command.ExecuteReader

                ''send register success notice
                Send("responseR||Registered!||", Server.clientSocket)
                Log(username & " has been registered!", txt_log)

                MySqlConnection.Close()
                MyData.Close()
            Else
                ''send failed notice
                Send("responseR||There was an error in registration||", Server.clientSocket)
                Log(username & " Username is allready in use!", txt_log)
                MySqlConnection.Close()
                MyData.Close()
            End If
            MySqlConnection.Close()
            MyData.Close()
        Catch ex As Exception
            Log(ex.Message, txt_log)
        End Try
    End Sub

You shouldnt need to use a While Data.Read() in the code