Last post Feb 14, 2012 12:35 AM by Decker Dong - MSFT
Feb 12, 2012 07:50 AM|javacookies|LINK
I have a website deployed on my localhost throuhg IIS. I thought everything was fine until I tried two clients browsing site simultaneously. Whenever they click a button that will do SELECT commands to my database(Menu.mdb), an error will occur. Right now
the error varies with one "dbconn.open" in red highlights and another is "Menucategory.DataBind()" in red highlights too. Any solution to this that I can do? I can't dispose access and try to replace it with sqlite or others, because tommorrow's our deadlin.
Please help me. I really need help. i'm crying right now LOL. Thank you very much. :)
Feb 12, 2012 08:05 AM|hans_v|LINK
As so nicely stated by another user in this forum (http://forums.asp.net/post/4812985.aspx), you'll need to provide some code as the ASP.NET Forums crystal ball isn't working today.
Feb 12, 2012 08:31 AM|javacookies|LINK
Feb 12, 2012 08:38 AM|javacookies|LINK
Private Sub dbcon()
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("database/" & "Menu.mdb"))
mdbcategory.DataFile = Server.MapPath("database/" & "Menu.mdb")
mdbcategory.SelectCommand = "SELECT category FROM Category"
mdbcategory.DataSourceMode = SqlDataSourceMode.DataSet
menucat.DataSource = mdbcategory
menucat.DataTextField = "category"
menucat.Width = 300
Feb 14, 2012 12:35 AM|Decker Dong - MSFT|LINK
Try to use "using……" block instead and immediately release the memory taken by the OleDbConnection：
using(OleDbConnection con = new OleDbConnection("……"))