Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Slow/quirky LocalDB reconnection on a WPF project after subsequent runs

$
0
0

I have made a very simple database setup for a WPF project. A localDB Database1.mdf is the base for a Dataset1.xsd which was created by drag and dropping the Table I need from the Server Explorer of the Database onto the Dataset Designer. I mainly deal with the data with Dataset variables and the Database Adapter without directly opening and closing the connection programmatically, other than using Update() and Fill() functions of the adapter.

It generally works well during execution, and it is 100% reliable to be up for a first run of the program. There is no issue with it during the program's execution. There is no apparent issue with it during closing the program and the adapter's .Connection.State.ToString() reports "Closed" right before closing and during execution.

However, if I do not wait for at least 10 to 20seconds after quickly re-running  the software 2-3 times, the reopening of the program may hang and after a few seconds the debugging report is "Login Failed" during the first Fill(). Why is that? Is there a limit of the server out of my control, or do I have to close connections manually somehow?







Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>