Results 1 to 27 of 27

Thread: Importing My Members List from My website ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Importing My Members List from My website ?

    Hi guys I'm working on small project for my site... basicly we have over 600 memembers.. and every day new member registers as we can keep of track of all the new members we would like to do the following

    By CLicking Button Importing members.php list in to our program so we can see all the new members that have registerd


    This is good for our modirator so they can keep an eye out on new members


    SO basicly

    I click button and my program grabs my user list from my website and puts it in my list box ( but program will have to go to page 2 then 3 and so on and so on )

    What would be the best way achiving this ?

    Thanks ( I just moved over from VB6 to VB 2008

  2. #2
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Importing My Members List from My website ?

    probably with ftp to the site to fetch the file
    or you could tackle using a wb control to navigate to the file as a user would (tedious)

    what happens if you navigate to that file in a normal web browser?

    www.yoursite.com/members.php

    does it show you the list of members or is it a bit more advanced?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    Quote Originally Posted by stateofidleness View Post
    probably with ftp to the site to fetch the file
    or you could tackle using a wb control to navigate to the file as a user would (tedious)

    what happens if you navigate to that file in a normal web browser?

    www.yoursite.com/members.php

    does it show you the list of members or is it a bit more advanced?
    Thanks State for reply basicly this is what Im working on for my clan and site Im moderator of



    Above pic has Info what I'm trying to achive it will be used on my site which is

    www.badhqclan.com
    and
    www.bf2s.com ( Im moderator of )

    instead of me opening up 2 different browsers to check on new members I can just open the program put in my info login put in url to location where members.php is located click Grab Users and it will display usernames in my list box and thats it


    Thanks again

    This is my first project in VB 2008 I just moved over from VB6 found it to hard to work with I find this loads easy


    Thank you again Breez

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    Ok I found this code on google

    Code:
        Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
            Dim sql = "SELECT UserID ,PassID FROM MYTAB WHERE USERID='" & UsernameTextBox.Text & "' AND PASSID='" & PasswordTextBox.Text & "'"
    
            cmd = New OleDbCommand(sql, conn)
            conn.Open()
            Dim dr As OleDbDataReader = cmd.ExecuteReader
    
            Try
                If dr.Read = False Then
                    MessageBox.Show("Authentication failed...")
                Else
                    MessageBox.Show("Login successfull...")
                End If
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
            conn.Close()
        End Sub
    But I think above is using a sql connection to connect to DB

    My Admins/Mods will input location of the URL and members in my ltextBox so I dont think I need to use SQL for it :s

  5. #5
    New Member
    Join Date
    Jul 2009
    Posts
    1

    Re: Importing My Members List from My website ?

    Could we use a data grid export? If so how could we go about doing this, while it takes several pages of data automatically?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    I Still need help with this if aone can point me to right direction

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    no one ?

  8. #8
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    I don't think that will quite work that code you got.
    That's somewhat right once you connect to the DB, but there is no connection code to access it in the first place.

    I've never connected to a mySQL database from a program before that was hosted elsewhere (or a mySQL database at all; I've only ever done Access.)
    I leave work in an hour, and if no-one has helped you by then, I'll try to see what I can come up with.
    Last edited by Seraph; Jul 28th, 2009 at 04:05 PM.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  9. #9
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    Sorry, couldn't get around to this tonight.
    Some stuff came up. If there are no resolutions or tips posted by tomorrow, I'll try again.
    Sorry about that.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    Thanks Seraph for reply Like I said above code is not something I wanted if you look at my Screen Shot u will see that I can just input location of my members list on text box and from that program should grab it

    Thanks again and I will be waiting on your reply

  11. #11
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    Well, it'd be the best way instead of parsing through a php file.
    All you would need to do is access the mySQL database, get a list of all the member names (and any other details from the table(s)) and print it to a gridview or listbox or listview or something.

    but, I'm at work right now. If I have some spare time or at lunch, maybe I'll get a chance to look at it before I go home even.

    And I wish you guys did CoD4. lol. I've had CoD4 for PS3, but find it on PC much mroe enjoyable and just recently got it and wouldn't mind finding a clan. But oh well.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    We do COD4 and COD5 so if u looking for clan u welcome to join

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: Importing My Members List from My website ?

    And also about sql connection what if other clans want to use this tool ? do I have to manualy add em every time some one downloads it ? 9 That was the reason I wanted to work by given URL in textbox ) it will be easyer

    I taught VB 2008 can grab webpage and I can clean up that page just to grab members.id's from it ?

  14. #14
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    *shrug* I suppose you can.
    I'm not too familiar with Parsing out webpages with VB and using the DOM and all that.

    However, the only other websites, regardless of if you go the SQL or members.php route, will be that they will have to be the same template site (Joomla, PHPNuke, etc).

    Your site will have a specific way of setting up it's SQL tables, the same as the code that is generated for the members page will be unique to that template, whether it be Joomla or PHP Nuke, etc.

    With SQL, all you would have to do is make the connection string variable so that someone else who wants to use it can put in the location of their DB and their username and password to access it. Again though, whichever route you take, it will only be viable for one website template solution.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  15. #15
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Post .NET and MySQL Quick Guide

    OK, so here is what I found about using MySQL to get this done.

    Things you will need to get or find out:

    MySQL dll's - http://dev.mysql.com/downloads/connector/net/ - Windows Binaries (ZIP)
    These are the references you need to be able to access a MySQL database.
    Once you have this installed, and start your project, you will need to make sure you add a Reference to MySql.Data
    (All assemblies are here: "C:\Program Files (x86)\MySQL\MySQL Connector Net <version>\Assemblies" if installed to the default folder.)

    *** HOW-TO ADD A REFERENCE ***
    ****************************
    In the Solution Explorer, there is a button along the top of the pane labeled "Show All Files".
    Click it and more items will show up in the Solution Explorer tree; one is labeled "References".

    Right-click it and choose "Add Reference...". It will take a little bit for the screen to pop up. When it does, click the "Browse" tab then go to the folder listed above and select just the MySQL.Data.dll file to add.
    ****************************
    ****************************

    Variables: (stuff you will need to plug into the appropriate places in the code below)
    <server address> - Address where the MySQL server is located
    <db_name> - The name of the database that will need to be accessed
    <username> - Username for access to the database
    <password> - Password for access to the database
    <table> - Table where data resides


    CODE:
    The following code will simply allow you to make sure you have a connection.

    Make a new Form, put two labels and a button on it. Sort of like you see in the first image I've attached.

    Open the Code window, delete everything, and past the following code:
    Code:
    Imports MySql.Data.MySqlClient
    
    Public Class Form1
            Try
                Dim conn As New MySql.Data.MySqlClient.MySqlConnection
                conn.ConnectionString = "Server=<server address>;Database=<db name>;Uid=<username>;Pwd=<password>;"
    
                conn.Open()
                Dim command As New MySqlCommand("SELECT COUNT(*) AS <field> FROM <table>", conn)
    
                Dim adapter As MySqlDataAdapter = New MySqlDataAdapter
                Dim table As DataTable = New DataTable
    
                adapter.SelectCommand = command
                adapter.Fill(table)
                Dim row As DataRow = table.Rows(0)
    
                Console.WriteLine(row("UserCount").ToString)
            Catch ex As Exception
                Console.WriteLine(ex.ToString)
            End Try
    End Class
    There is a Try...Catch block to catch any errors you have that may occur so you can get a general idea what is wrong if something gives an error.

    NOTE: You may need to allow access to your MySQL databases remotely. On my Webhost, access was restricted to 192.168.1.%, which meant that only my webserver to connect directly to it. I had to add a reference to %.%.%.% to allow any incoming IP address direct access to the database.

    Of course you will have to modify the SQL statements for your own needs, but that is just an example bit of code.
    Last edited by Seraph; Oct 9th, 2012 at 09:25 AM. Reason: Modified some verbiage and checked to see if information was still valid.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  16. #16

  17. #17
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    lol. On PS3, it's SeraphX2 (which I don't play much)
    On PC, it's Seraph. I play mostly on cTx servers.
    I was playing on Damage Incorporated, but they were crashing alot so I switched to cTx.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  18. #18

  19. #19
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    On DI, or cTx?
    You're name looks familiar.
    I guess with only 350+ servers for CoD4, unlike thousands for CSS, you're bound to run into people more often. lol.
    I've only had CoD4 for PC since the beginning of July.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  20. #20
    Addicted Member
    Join Date
    Jul 2007
    Location
    Slovenia
    Posts
    131

    Re: Importing My Members List from My website ?

    Seraph, I added references to my project and imported MySql.Data.MySqlClient, but namespace "MySql.Data.MySqlClient.MySqlConnection" still cannot be found. What else do I have to do?
    If this post helped you, rate it!

  21. #21
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    Dunno. If you follow the steps above you should be fine.
    I can't think of anything else, and I looked at my example file on my PC and can't see anything else.

    Are you sure you added a reference to MySQL.Data in the Solution Explorer area?

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  22. #22
    Addicted Member
    Join Date
    Jul 2007
    Location
    Slovenia
    Posts
    131

    Re: Importing My Members List from My website ?

    Where is that 'MySQL.Data'? I just added those references to project in properties...
    If this post helped you, rate it!

  23. #23
    Addicted Member
    Join Date
    Jul 2007
    Location
    Slovenia
    Posts
    131

    Re: Importing My Members List from My website ?

    Actually none of namespaces works...
    Do you have this project still on your computer? Maybe if you could send me whole solution. I really need to connect to my database somehow from application.
    If this post helped you, rate it!

  24. #24
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    Sorry, I don't have the original program.
    However, the code above is all the program really was.
    You sure you did everything exactly right?

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  25. #25
    Addicted Member
    Join Date
    Jul 2007
    Location
    Slovenia
    Posts
    131

    Re: Importing My Members List from My website ?

    Well I added code to Button.Click event, because it can't be without event... References I added are files selected files below on picture (5 dll's). And these are errors:

    - Error 1 'MySqlConnection' is ambiguous in the namespace 'MySql.Data.MySqlClient'.
    - Error 2 'MySqlCommand' is ambiguous in the namespace 'MySql.Data.MySqlClient'.
    - Error 3 'MySqlDataAdapter' is ambiguous in the namespace 'MySql.Data.MySqlClient'.

    Attached Images Attached Images  
    If this post helped you, rate it!

  26. #26
    Addicted Member
    Join Date
    Jul 2007
    Location
    Slovenia
    Posts
    131

    Re: Importing My Members List from My website ?

    It works now. I added just MySQL.Data.dll reference to project and nothing else.
    If this post helped you, rate it!

  27. #27
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Importing My Members List from My website ?

    Well, I just woke up
    And I was just about to tell you the same thing: Only have MySQL.Data.
    Glad you got it on your own.
    Any other questions, just post here and I'll probably answer rather quickly, even at work.
    I have google mail and the desktop google monitor so I see as soon as I get an email.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width