Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. How can I read a link from databse in vb.net

How can I read a link from databse in vb.net

Scheduled Pinned Locked Moved Visual Studio
announcementcsharpdatabasemysql
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mnxford
    wrote on last edited by
    #1

    I made my software in vb.net and connected it with MySQLDatabse and using phpmyadmin I have create a table update and a column version.... In the version column I have inserted the link of version.txt Now I want that my update library which is updateVB will get the link of version.txt from the databse from that table.... The UpdateVB component strings are:

    Updatevb1.checkforupdate("Text file where your version is stated (URL)",
    "Current Version",
    "URL of executable updater (SFX Archive),
    "Username for FTP", "Password for FTP",
    showUI As Boolean)

    I want to get every of these informations like: Text file version URL, current version, URL of executable update etc... I want all the informations to read from the database.... I have tried this in my update.vb:

    Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        conn = New MySqlConnection(ServerString)
        Try
            conn.Open()
            Dim sqlquery As String = "SELECT FROM updater"
            Dim data As MySqlDataReader
            Dim adapter As New MySqlDataAdapter
            Dim command As New MySqlCommand
            command.CommandText = sqlquery
            command.Connection = conn
            adapter.SelectCommand = command
            data = command.ExecuteReader
            While data.Read()
                If data.HasRows() Then
                    Dim vlink As String = data(1).ToString
                    Dim dlink As String = data(2).ToString
                    Dim ftpu As String = data(3).ToString
                    Dim ftpp As String = data(4).ToString
                End If
            End While
            UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
            data.Close()
            conn.Close()
        Catch ex As Exception
        End Try
    End Sub
    

    I used mysqlreader here to get the links...but it doesn't work....

    L M 3 Replies Last reply
    0
    • M mnxford

      I made my software in vb.net and connected it with MySQLDatabse and using phpmyadmin I have create a table update and a column version.... In the version column I have inserted the link of version.txt Now I want that my update library which is updateVB will get the link of version.txt from the databse from that table.... The UpdateVB component strings are:

      Updatevb1.checkforupdate("Text file where your version is stated (URL)",
      "Current Version",
      "URL of executable updater (SFX Archive),
      "Username for FTP", "Password for FTP",
      showUI As Boolean)

      I want to get every of these informations like: Text file version URL, current version, URL of executable update etc... I want all the informations to read from the database.... I have tried this in my update.vb:

      Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          conn = New MySqlConnection(ServerString)
          Try
              conn.Open()
              Dim sqlquery As String = "SELECT FROM updater"
              Dim data As MySqlDataReader
              Dim adapter As New MySqlDataAdapter
              Dim command As New MySqlCommand
              command.CommandText = sqlquery
              command.Connection = conn
              adapter.SelectCommand = command
              data = command.ExecuteReader
              While data.Read()
                  If data.HasRows() Then
                      Dim vlink As String = data(1).ToString
                      Dim dlink As String = data(2).ToString
                      Dim ftpu As String = data(3).ToString
                      Dim ftpp As String = data(4).ToString
                  End If
              End While
              UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
              data.Close()
              conn.Close()
          Catch ex As Exception
          End Try
      End Sub
      

      I used mysqlreader here to get the links...but it doesn't work....

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please:

      1. Post your query in the correct forum.
      2. Format your code properly and put it inside <pre> tags for readability.

      Use the best guess

      M 1 Reply Last reply
      0
      • L Lost User

        Please:

        1. Post your query in the correct forum.
        2. Format your code properly and put it inside <pre> tags for readability.

        Use the best guess

        M Offline
        M Offline
        mnxford
        wrote on last edited by
        #3

        The no.2 connection is done... But I am not able to do the correction no.1 because I think it is the right section...if not then please move the topic to the right section.....

        L 1 Reply Last reply
        0
        • M mnxford

          I made my software in vb.net and connected it with MySQLDatabse and using phpmyadmin I have create a table update and a column version.... In the version column I have inserted the link of version.txt Now I want that my update library which is updateVB will get the link of version.txt from the databse from that table.... The UpdateVB component strings are:

          Updatevb1.checkforupdate("Text file where your version is stated (URL)",
          "Current Version",
          "URL of executable updater (SFX Archive),
          "Username for FTP", "Password for FTP",
          showUI As Boolean)

          I want to get every of these informations like: Text file version URL, current version, URL of executable update etc... I want all the informations to read from the database.... I have tried this in my update.vb:

          Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
              conn = New MySqlConnection(ServerString)
              Try
                  conn.Open()
                  Dim sqlquery As String = "SELECT FROM updater"
                  Dim data As MySqlDataReader
                  Dim adapter As New MySqlDataAdapter
                  Dim command As New MySqlCommand
                  command.CommandText = sqlquery
                  command.Connection = conn
                  adapter.SelectCommand = command
                  data = command.ExecuteReader
                  While data.Read()
                      If data.HasRows() Then
                          Dim vlink As String = data(1).ToString
                          Dim dlink As String = data(2).ToString
                          Dim ftpu As String = data(3).ToString
                          Dim ftpp As String = data(4).ToString
                      End If
                  End While
                  UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
                  data.Close()
                  conn.Close()
              Catch ex As Exception
              End Try
          End Sub
          

          I used mysqlreader here to get the links...but it doesn't work....

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          mnxford wrote:

          but it doesn't work....

          That's not very descriptive. At the moment, it does not report errors, you're "swallowing" those.

              Catch ex As Exception
              End Try
          

          Remove those lines, and the "try", and it should raise an exception on the place where it goes wrong. In this case, it'd be the SQL-statement; you did not select any columns. Try "SELECT * FROM" or add in the correct column names. I'd also recommend wrapping the Connection, the Command and the Reader in a USING statement. Also, it'd be a bit more readable if you called the reader "reader", and not "data". It's not a data-structure, it's a class that fetches information.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          M 1 Reply Last reply
          0
          • L Lost User

            mnxford wrote:

            but it doesn't work....

            That's not very descriptive. At the moment, it does not report errors, you're "swallowing" those.

                Catch ex As Exception
                End Try
            

            Remove those lines, and the "try", and it should raise an exception on the place where it goes wrong. In this case, it'd be the SQL-statement; you did not select any columns. Try "SELECT * FROM" or add in the correct column names. I'd also recommend wrapping the Connection, the Command and the Reader in a USING statement. Also, it'd be a bit more readable if you called the reader "reader", and not "data". It's not a data-structure, it's a class that fetches information.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            M Offline
            M Offline
            mnxford
            wrote on last edited by
            #5

            can you provide me with the corrected code???That will be very helpful for me....

            L 1 Reply Last reply
            0
            • M mnxford

              The no.2 connection is done... But I am not able to do the correction no.1 because I think it is the right section...if not then please move the topic to the right section.....

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              mnxford wrote:

              I think it is the right section

              Your question is about using a Database in VB.NET, both of which have their own forums. This forum is for questions and problems with Visual Studio.

              Use the best guess

              M 1 Reply Last reply
              0
              • M mnxford

                can you provide me with the corrected code???That will be very helpful for me....

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                We're volunteers, and I'm at work. You'll have to write it yourself, or find someone who will.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                1 Reply Last reply
                0
                • M mnxford

                  I made my software in vb.net and connected it with MySQLDatabse and using phpmyadmin I have create a table update and a column version.... In the version column I have inserted the link of version.txt Now I want that my update library which is updateVB will get the link of version.txt from the databse from that table.... The UpdateVB component strings are:

                  Updatevb1.checkforupdate("Text file where your version is stated (URL)",
                  "Current Version",
                  "URL of executable updater (SFX Archive),
                  "Username for FTP", "Password for FTP",
                  showUI As Boolean)

                  I want to get every of these informations like: Text file version URL, current version, URL of executable update etc... I want all the informations to read from the database.... I have tried this in my update.vb:

                  Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                      conn = New MySqlConnection(ServerString)
                      Try
                          conn.Open()
                          Dim sqlquery As String = "SELECT FROM updater"
                          Dim data As MySqlDataReader
                          Dim adapter As New MySqlDataAdapter
                          Dim command As New MySqlCommand
                          command.CommandText = sqlquery
                          command.Connection = conn
                          adapter.SelectCommand = command
                          data = command.ExecuteReader
                          While data.Read()
                              If data.HasRows() Then
                                  Dim vlink As String = data(1).ToString
                                  Dim dlink As String = data(2).ToString
                                  Dim ftpu As String = data(3).ToString
                                  Dim ftpp As String = data(4).ToString
                              End If
                          End While
                          UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
                          data.Close()
                          conn.Close()
                      Catch ex As Exception
                      End Try
                  End Sub
                  

                  I used mysqlreader here to get the links...but it doesn't work....

                  M Offline
                  M Offline
                  Marco Bertschi
                  wrote on last edited by
                  #8
                  Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                      conn = New MySqlConnection(ServerString)
                      
                          conn.Open()
                          Dim sqlquery As String = "SELECT FROM updater"
                          Dim data As MySqlDataReader
                          Dim adapter As New MySqlDataAdapter
                          Dim command As New MySqlCommand
                          command.CommandText = sqlquery
                          command.Connection = conn
                          adapter.SelectCommand = command
                          data = command.ExecuteReader
                          While data.Read()
                              If data.HasRows() Then
                                  Dim vlink As String = data(1).ToString
                                  Dim dlink As String = data(2).ToString
                                  Dim ftpu As String = data(3).ToString
                                  Dim ftpp As String = data(4).ToString
                              End If
                          End While
                          UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
                          data.Close()
                          conn.Close()
                      
                  End Sub
                  

                  This code should throw an error message 'round your head to get you to a possible solution.

                  cheers Marco Bertschi


                  Software Developer & Founder SMGT Web-Portal CP Profile | Twitter | Facebook | SMGT Web-Portal


                  FizzBuzz - Gary Wheeler

                  1 Reply Last reply
                  0
                  • L Lost User

                    mnxford wrote:

                    I think it is the right section

                    Your question is about using a Database in VB.NET, both of which have their own forums. This forum is for questions and problems with Visual Studio.

                    Use the best guess

                    M Offline
                    M Offline
                    mnxford
                    wrote on last edited by
                    #9

                    m0ve this topic to the right section plzzz......

                    L 1 Reply Last reply
                    0
                    • M mnxford

                      m0ve this topic to the right section plzzz......

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Sorry that's not my role in life. You can edit the original to say it's been moved, and open a new question in the right place; CodeProject is very much a do-it-yourself site.

                      Use the best guess

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups