R
RichGK
I have an abstract class that provides the basis for SQL data access
functions, with the subclasses building on this to create access to tables
via select query strings.
I have created the subclasses as static as all they contain are (for
example) a select query string, and a method to return the results of a
SqlSelect query. (SqlSelect is my own class that simply wraps the creation
of DataSet etc).
So everything in the subclass is static.
namespace DataAccess
{
public class EmployeeTDG : DataAccess.TDG
{
private static string selectString = "SELECT [name] FROM [Employee] ORDER BY
[name] ASC";
public static SqlSelect getEmployees(SqlConnection sc)
{
return TDG.executeSelectQuery(EmployeeTDG.selectString, sc);
}
}
}
My question is, is this ok? My concerns are that maybe I've overlooked
something that might bite me in the backside later!
Cheers
Rich.
functions, with the subclasses building on this to create access to tables
via select query strings.
I have created the subclasses as static as all they contain are (for
example) a select query string, and a method to return the results of a
SqlSelect query. (SqlSelect is my own class that simply wraps the creation
of DataSet etc).
So everything in the subclass is static.
namespace DataAccess
{
public class EmployeeTDG : DataAccess.TDG
{
private static string selectString = "SELECT [name] FROM [Employee] ORDER BY
[name] ASC";
public static SqlSelect getEmployees(SqlConnection sc)
{
return TDG.executeSelectQuery(EmployeeTDG.selectString, sc);
}
}
}
My question is, is this ok? My concerns are that maybe I've overlooked
something that might bite me in the backside later!
Cheers
Rich.