T
TerryStone
I am writing a Windows application, with an SQL Server (Express)
database. The application is single user. The Windows application is
the only application that accesses the database.
I have been programming Windows application for years, but using Visual
C++. With C++ I would create a database class inherited from
CDaoDatabase, that encapsulated all the database storage I required.
The database class would make use of many recordset classes. The
database class would have functions like:
bool Open();
void Close();
bool AddUser( CUser* pUser );
bool LoadUsers( CListCtrl* plst );
There would be no access to the database unless it was through the
database class.
Now I have been dropped into the world of C#, and have been trying to
find the equivilent classes for CDaoDatabase and CDaoRecordset, and I
suspect there arn't any. And the majority of examples I've found bind
a dataset to a control, with little code to examine.
What is best practice? Should I create a Database class based on
SqlConnection, and create a DataSet for every table in the database?
My thanks to anyone who reads this.
Terry.
database. The application is single user. The Windows application is
the only application that accesses the database.
I have been programming Windows application for years, but using Visual
C++. With C++ I would create a database class inherited from
CDaoDatabase, that encapsulated all the database storage I required.
The database class would make use of many recordset classes. The
database class would have functions like:
bool Open();
void Close();
bool AddUser( CUser* pUser );
bool LoadUsers( CListCtrl* plst );
There would be no access to the database unless it was through the
database class.
Now I have been dropped into the world of C#, and have been trying to
find the equivilent classes for CDaoDatabase and CDaoRecordset, and I
suspect there arn't any. And the majority of examples I've found bind
a dataset to a control, with little code to examine.
What is best practice? Should I create a Database class based on
SqlConnection, and create a DataSet for every table in the database?
My thanks to anyone who reads this.
Terry.