Menu

#92 Connection does not open or timeout....

open
nobody
None
5
2004-03-04
2004-03-04
No

I have the following code that works about 95% of the time:

Imports ByteFX.Data.MySqlClient
Imports System.Web.Mail
Imports System.Text

Friend Class DB
Friend Shared connstr As String = "Data
Source=MSS003;database=Midwest;user
ID=Global;password=****;connect timeout=5"

Public Sub fillProducts(ByVal ds As DataSet)
Dim conn As New MySqlConnection(connstr)
conn.Open()
Dim cmd As New MySqlCommand

cmd.Connection = conn

cmd.CommandText = "SELECT ProductID,
ProductName, LegacySKU, UnitSize, Color, CatagoryID, " & _
"StockNumber from Products Where SoldOut = '0'"

Dim daProdID As MySqlDataAdapter = New
MySqlDataAdapter(cmd)

daProdID.Fill(ds, "Products")

conn.Close()
End Sub

End Class

The other 5% of the time the application hangs at the
conn.open() line, and I must end task the app, the redo
the action then it works.

Any ideas why this may be happening? Please let me
know if you need any other info from me on this item.

Discussion

  • Reggie Burnett

    Reggie Burnett - 2004-03-04

    Logged In: YES
    user_id=523261

    This could be pooling. What version of the provider are you
    using? Also, add pooling=false to your connection string
    and see if it still happens.

    Reggie

     
  • Brandon Schenz

    Brandon Schenz - 2004-03-04

    Logged In: YES
    user_id=823798

    I'm using .75, and will try adding pooling=false to the
    connection string to see what happens.

    Brandon

     
  • Nobody/Anonymous

    Logged In: NO

    i have the same problem! but i have it in 100% of the time...

    after the open command, there's no timeout...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.