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