C # write a code generator

Source: Internet
Author: User
In practice, we need to write a large number of programs, for example, to convert a table into a class object or write a method to call a stored procedure with N parameters, You need to manually enter a large amount of code, and there is a lot of repeated code. To avoid a lot of repetitive work and work convenience, I wrote such a simple code generator based on my own needs. Its functions are as follows:
Function 1:
Configure the database connection server (including the IP address, database, Logon account, and logon password of the database server), click OK to save the configuration, and the OK button is unavailable. A message dialog box is displayed.
Function 2;
Connect to the database. The corresponding user tables, stored procedures, and views are listed.
Function 3:
Generate code. In the Class Name text box, enter the name of the class to be generated, select the corresponding table, stored procedure, or view, and click Generate code. The generated code is saved in the root directory of drive C and displayed in the text box. For user tables or views, classes with attributes and constructor are generated. For stored procedures, classes with methods for calling stored procedures are generated.

How to use it. Configure the database before use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.