Simple application of Sqlite

Source: Internet
Author: User
Tags sqlite

Initialize a connection:

Sqliteconnection.createfile ("hisine.db"new sqliteconnection ("  Data source=hisine.db; version=3; " ); M_dbconnection.open (); string " CREATE table orders (creation time, product information, item ID, payment amount, effect estimate, order number, AD bit name, refund date) "  New  sqlitecommand (sql, m_dbconnection); command. ExecuteNonQuery ();
M_dbconnection.close ();

Returns the query to the SQL statement to the DataTable

PrivateDataTable sqlquerydatatable (stringsql//returns the query record of the SQL statement to the DataTable{DataTable table=NewDataTable (); if(M_dbconnection.state! =ConnectionState.Open)returntable; Sqlitecommand cmd=Newsqlitecommand (SQL, m_dbconnection); Sqlitedataadapter DataAdapter=NewSqlitedataadapter (); Dataadapter.selectcommand=cmd;            DataAdapter.Fill (table); returntable; }

Simple application of Sqlite

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.