C# Data Tier Generator | |
Source Forge Project Information | Download |
Based on that information, it queries the database for all user tables (tables created in the database by somthing other than SQL Server itself), and iterates through each table, creating appropriate files.
The files it generates are created in two seperate folders:
<ApplicationPath>\SQL Scripts
<ApplicationPath>\Data Access Classes
Several files are created for each user table in the database. Each file contains SQL script for creating stored procedures. The stored procedures contain the following functionality:
The formula for creating stored procedures is as follows:
proc + TableName + StoredProcedureType
@Paramter DataType,
@Paramter DataType,
...
AS
SELECT, INSERT, UPDATE, or DELETE SQL
...
Examples of scripts:
Whereas seperate script files are generated for each procedure, there is only one class file generated for each table.
The formula for creating class files is as follows:
public class cls + TableName {
public void Insert(...) {
<SqlDb code>
}
public void Update(...) {
<SqlDb code>
}
...
}