Just complete a database operation class, but can it be used?

Source: Internet
Author: User

Today, nothing to do, the former own a database operation class re-organized a bit, the naming standard a bit, location and function re-planning a bit.

Source code Download: Http://files.cnblogs.com/xiaoshuai1992/xsFrameWork.SqlServer.zip

Please look at the pictures and introduction

Dboperate folder

Dbaccess class: The core class, the use of ADO to operate the database.

Dbinparameter: Parameters passed into the dbaccess, such as parameters, SQL statements, SP names, whether the SP is executing or returning data.

Dboutparameter: Outgoing parameters, such as datasets, execute results, run out parameters of the SP.

For ease of operation, add 2 additional files, run SQL directly and run SP separately, so it is clear.

Spoperate folder

Sphelper class: Mainly 3 methods executesp,getdataset,getdatatable

Xsspparameter class: Executes SP's parameter class, which contains string connection, parameter, SP name, whether to return data.

Why is it called xsspparameter instead of Spparameter? The main is the SqlParameter is the system comes with the class, in order to distinguish, so the 2 of the class is preceded by the XS

Sqloperate folder

SqlHelper class: Mainly Getdataset,getdatatable,exist,execute class, perform some common functions, query, Judge existence, execute SQL

Xssqlparameter class: SQL statement, database connection string, parameters.

Here Xssqlparameter and Xsspparameter both add and remove parameters, and the parameters are overwritten if they are added repeatedly. Because you always want to use it when defining parameters in your program, you don't have to define many of the same classes. To perform a n-update, just overwrite the parameter to OK.

However, there is still a problem, first I write the transaction does not have the corresponding processing procedures, only the original ecological use of dbaccess, and, this class has not been tested, but also needs to be constantly updated and perfected. If there is any improvement, please point out that we can study together.

Source code Download: Http://files.cnblogs.com/xiaoshuai1992/xsFrameWork.SqlServer.zip

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.