Gsql of operating database without SQL Server service locally

Source: Internet
Author: User

As programmers, whether we write a variety of MIS systems or games are inseparable from the data access operations, as we did in the previous few days in VS a mis system, now tangled.

If the C/s or b/S model is good, but the demand is not, no way, the customer is God ... Their needs are localized to the database directly to operate (in the case of not installing SQL Server), the brothers have a solution to the idea???

The crowd sought him 1100 degrees, but Gsql was deep in my heart. Alas, now feel look forward, the problem can be solved, then download the gsql_6.5.0.4

Download link Http://www.powerip.net/GSQL/GSQL_6.5.0.4.rar

It's starting with the environment.

1, Unzip first

2, double-click Gsql.exe If no response, force shutdown, restart. 3, the service has been opened, followed by the database to remember the data cry path into a relative path Oh! Here I will no longer wordy, online tutorials. The following link code:
usingSystem;usingSystem.Collections.Generic;usingSystem.Data.SqlClient;usingSystem.Linq;usingSystem.Text;namespacepharmacopeia{/// <summary>    ///Database connection Layer/// </summary>     Public classCdbresource {/// <summary>        ///connection objects for the database/// </summary>        Private StaticSqlConnection _con; /// <summary>        ///gets the linked object of the database/// </summary>         Public StaticSqlConnection Connection {Get{return_con;} }        /// <summary>        ///static constructors, initializing database connections/// </summary>        StaticCdbresource () {stringConnection ="Server = '" 127.0.0.1", 7788 ';D atabase = Pharmacopeia; User Id=sa; Password=admin; Trusted_Connection = False; Multipleactiveresultsets = True"; _con=NewSqlConnection (connection); _con.        Open (); }        /// <summary>        ///static interface, freeing up database connections/// </summary>         Public Static voiddisposeconnection () {_con.        Close (); }    }}


Operation Result:

Actually very simple, really do not have to install SQL Server to take care of, you can try, there are problems to learn together Oh!

Related Article

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.