Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid

    [Help] remote sql connection

    k, i'v been searching, and trying so many things and not comingup with any way of doing this.

    basicly, i want it to do this.

    button clicked:
    --username.txt to a string
    --password.txt to a string
    open remote connection with username and password to remote connection

    if sucsessfull, msgbox "hello world"
    if not, msgbox "error"

    thats it.
    this is what i'v got...most complete code...
    Code:
    Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
      conn = New MySqlConnection()
      conn.ConnectionString = "server=" & "server IP" & ";" _
        & "user id=" & txtUsername.Text & ";" _
        & "password=" & txtPassword.Text & ";" _
        & "database= usertable"
    
      Try
        conn.Open()
        MessageBox.Show("user accepted, application starting")
        conn.Close()
        frmbrowser.show()
        me.close()
      Catch myerror As MySqlException
        MessageBox.Show("incorrect password")
      Finally
        conn.Dispose()
      End Try
    End Sub
    anybody tell me where im going wrong?

  2. #2
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    Code:
    conn.ConnectionString = string.format("server=" & "server IP" & ";" & "user id=" & txtUsername.Text & ";" & "password=" & txtPassword.Text & ";" & "database= usertable")
    Try that.

  3. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by *****179 View Post
    k, i'v been searching, and trying so many things and not comingup with any way of doing this.

    basicly, i want it to do this.

    button clicked:
    --username.txt to a string
    --password.txt to a string
    open remote connection with username and password to remote connection

    if sucsessfull, msgbox "hello world"
    if not, msgbox "error"

    thats it.
    this is what i'v got...most complete code...
    Code:
    Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
      conn = New MySqlConnection()
      conn.ConnectionString = "server=" & "server IP" & ";" _
        & "user id=" & txtUsername.Text & ";" _
        & "password=" & txtPassword.Text & ";" _
        & "database= usertable"
    
      Try
        conn.Open()
        MessageBox.Show("user accepted, application starting")
        conn.Close()
        frmbrowser.show()
        me.close()
      Catch myerror As MySqlException
        MessageBox.Show("incorrect password")
      Finally
        conn.Dispose()
      End Try
    End Sub
    anybody tell me where im going wrong?
    Do you actually put the serverIP in the connection string? And are you sure the username you're putting in is the UserID for the database? You've got to have the right database credentials.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. #4
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by *****179 View Post
    k, i'v been searching, and trying so many things and not comingup with any way of doing this.

    basicly, i want it to do this.

    button clicked:
    --username.txt to a string
    --password.txt to a string
    open remote connection with username and password to remote connection

    if sucsessfull, msgbox "hello world"
    if not, msgbox "error"

    thats it.
    this is what i'v got...most complete code...
    Code:
    Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
      conn = New MySqlConnection()
      conn.ConnectionString = "server=" & "server IP" & ";" _
        & "user id=" & txtUsername.Text & ";" _
        & "password=" & txtPassword.Text & ";" _
        & "database= usertable"
    
      Try
        conn.Open()
        MessageBox.Show("user accepted, application starting")
        conn.Close()
        frmbrowser.show()
        me.close()
      Catch myerror As MySqlException
        MessageBox.Show("incorrect password")
      Finally
        conn.Dispose()
      End Try
    End Sub
    anybody tell me where im going wrong?
    Your connection string has the literal text "Server IP" in it. You're supposed to replace that with the actual server address or IP.

  5. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post
    Your connection string has the literal text "Server IP" in it. You're supposed to replace that with the actual server address or IP.
    That's what I said, but he could have just changed it out so we don't steal his server IP

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. #6
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    i did change it.
    details are correct.
    mnpeep, tryed it. nothing happened...

  7. #7
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by mnpeepno2 View Post
    Code:
    conn.ConnectionString = string.format("server=" & "server IP" & ";" & "user id=" & txtUsername.Text & ";" & "password=" & txtPassword.Text & ";" & "database= usertable")
    Try that.
    Why would you use String.Format and then put no formatting in though .

    @Poster, what's the actual problem? You just said is anything wrong, which apparently there isn't (at least with this section of code) so what's the problem? Not logging in?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  8. #8
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Try this:

    private conn as new mysqlconnection(String.Format("server={0};user id={1};password={2};database={3};", ip,username,password,database))

    I guess the last ; is missing.



  9. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Blubb1337 View Post
    Try this:

    private conn as new mysqlconnection(String.Format("server={0};user id={1};password={2};database={3};", ip,username,password,database))

    I guess the last ; is missing.
    You don't need a final semicolon though?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  10. #10
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Jason View Post


    You don't need a final semicolon though?
    MySQL Connection String Samples - ConnectionStrings.com



  11. #11
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    My connection string didn't end in a semicolon and I've never had problems with it

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  12. #12
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Jason View Post
    My connection string didn't end in a semicolon and I've never had problems with it
    I just wanted to make sure it isn't such stupid mistake


    He should just tell us what error he's getting.



  13. #13
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Blubb1337 View Post
    I just wanted to make sure it isn't such stupid mistake


    He should just tell us what error he's getting.
    Yeah, guess we just have to wait on his feedback now.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #14
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    Quote Originally Posted by Jason View Post


    Why would you use String.Format and then put no formatting in though .

    @Poster, what's the actual problem? You just said is anything wrong, which apparently there isn't (at least with this section of code) so what's the problem? Not logging in?
    its in string format -.-

  15. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by mnpeepno2 View Post
    its in string format -.-
    Do you know what string.format even is?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  16. The Following User Says Thank You to Jason For This Useful Post:

    Blubb1337 (02-02-2011)

Page 1 of 2 12 LastLast