Ads Area

C# DAL Generator Free Download

C# DAL Generator Free Download 
C# DAL Generator is a windows desktop application that generates C# data access layer for the whole database by single click. The purpose of the application is to make software development easy.


  • It creates C# classes (one for each table).
  • The class contains all columns of the table as properties.
  • Data types have been handled nicely.
  • Creates methods for CRUD operations (Add, Update, Delete, Get and GetAll methods are created).
  • Primary key is automatically detected for each table.
  • Composite primary key is supported.
  • Nullable columns have been handled.
  • Identity column has been handled.
  • Timestamp column has been handled.
  • Completely indented code is generated.
  • The generated code can be used in both desktop and web applications.
  • All the following data types are supported:
    char, nchar, varchar, nvarchar, text, ntext, xml, decimal, numeric,
    money, smallmoney, bit, binary, image, timestamp, varbinary, date,
    datetime, datetime2, smalldatetime, datetimeoffset, time, bigint,
    int, smallint, tinyint, float, real, uniqueidentifier, sql_variant
  • Source code has also been provided so that to enable users to make changes according to their programming structure.

How To Use?

  • Enter the database connection information and click Connect button.
  • Select the tables for which you want to create C# classes. Also select the methods you want to add to the class.
  • Specify ‘GetAll’ method options.
  • Specify output location.
  • Specify namespace and connection string name and click Generate Codebutton.

Fields Details:

  • Server Name: It is name or IP address of the database server.
  • Database Name: It is name of the database.
  • Integrated Security: Check this if you are using integrated security.
  • User Name: It is name of the database user. It is not required if using integrated security.
  • Password: It is password of the database user. It is not required if using integrated security.
  • Tables: These are all the tables of the database.
  • Output Location: The directory where all the C# classes will be saved.
  • Overwrite Existing File: If checked, the existing file will be overwritten.
  • Namespace: It is the Namespace in which the class will be created.
  • Con. String Name: Name of the connection string in the web.config file.
  • Error Log: Error messages will be shown in this field.
  • GetAll Method Options: It provides options for the GetAll method of the selected table.
    • Select Columns: These are columns of the SELECT clause.
    • Search Columns: These columns will be added to the WHERE clause of the SELECT statement. It’s useful when we provide grid and search feature for the table.
    • Logical Operator: This operator is used in the WHERE clause for multiple columns.
    • Use ‘Like’ Operator for String Values: If checked, ‘Like’ operator will be used for comparison of the character type columns, otherwise equal operator will be used.

Sample Application:

A sample web application has also been provided that is using the generated code. In this application one form (for employees) has been created. This app uses the generated data access layer without modifying a single line in the generated code.


  • If you add the generated classes to a new created C# library and you get the error “The name ‘ConfigurationManager’ does not exist in the current context” then add reference to the System.Configuration library.
  • If the table/column name contains characters that are invalid for C# identifier then those characters will be replaced with underscore (_). And so it is also possible that two or more names are made same, so those names will be made unique by using an algorithm.
  • First character of class/property name is converted to capital.
  • First character of local variable is converted to small.
  • If first character of table/column name is not a letter then it is prefixed with C.
  • If table/column name is a C# keyword then it is prefixed with @ sign.

Generated Code:

  • C# Class: For each table one C# class is created that contains all columns of the table as properties.
  • Add Method: It is an instance method. It adds a new record to the relevant table. Nullable columns have been handled properly. If you don’t want to insert values in the nullable columns, don’t specify values for the relevant properties. Identity and timestamp columns cannot be inserted manually therefore these columns are skipped while inserting a record. Relevant property of the identity column is populated after record is inserted.
  • Update Method: It is an instance method. It updates an existing record. Identity and timestamp columns are skipped while updating a record.
  • Delete Method: It is a static method. It deletes an existing record. It takes primary key columns values as parameters.
  • Get Method: It is a static method. It gets an existing record (an instance of the class is created and all properties are populated). It takes primary key columns values as parameters.
  • GetAll Method: It is a static method. It gets all records of the relevant table. You can also specify search columns.

Post a Comment

* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad