New answers tagged

0

Start with some building blocks first: make a class MyConfigData, a simple DTO object, no special logic here. It should hold all the configuration data you want to manage implement methods void SetData(MyConfigData config) and MyConfigData GetData() in your form - these two methods should transfer the data from the DTO object into the form, and vice versa. ...


0

> Is there any clean way of disconnecting the save > logic from the WinForm that will enable me to reuse the save code? Usually this is solved by implementing a Three-tier_architecture Data Object Class with a property of all attributes used in the database and the gui a gui layer that transfers data between Data Object and gui database or ...


5

.net already uses connection pooling, so when you create/dispose a connection, you are not actually opening and closing a database connection, just fetching and returning a connection to the pool. So you don't really get any benefit by changing to Open/Close, and the using construct guarantees that the connection is returned to the pool correctly even in ...


-3

is it bad to only be using 1 connection for a small personal program that accesses 1 database (and 2 tables) You should not limit program to 1 connection. Sooner you will end up situations you require more than one simultaneous connections, Built in connection pooling, is reusing connections and will only return connections to pool when you close it (...



Top 50 recent answers are included