Connection to MySQL through HTTP using Vb.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    Connection to MySQL through HTTP using Vb.NET

    Hi all, i am looking for a way to connect to a Remote MySQL server through HTTP using VB.NET. Actually my application has no direct access to internet. The application connects to a proxy server which is blocking access to database server. The proxy server only allows web requests. How can i connect in this scenario. Please help
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I believe that it can be done via HttpWebRequest. One example I saw used https and this code:
    Code:
    req.Proxy = GlobalProxySelection.GetEmptyWebProxy();

    Comment

    • rizwan6feb
      New Member
      • Jul 2007
      • 108

      #3
      Thanks kenobewan
      Previously i have been using the following code to connect to MySQL server after adding a reference to MySQL.Data.dll

      Code:
              Dim cnString As String
              cnString = "server=xxx.xxx.xxx.xxx;database=dbname;UID=user;password=123;"
              cn = New MySqlConnection(cnString)
              cn.Open()
              MsgBox("connected")
      xxx.xxx.xxx.xxx is the ip address of MySQL server

      I have no idea how to use HttpWebRequest with above code.

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Here is an article that may help:
        A Deeper Look at Performing HTTP Requests in an ASP.NET Page

        Comment

        Working...