Visual Studio 2010 and later, connect to SQLite database
1. Download SQLite. EXE installation package at SQLite development site
Ctrl+f Search for this statement: The is capable of installing, the Design-time components for Visual Studio xxxx
Find the corresponding VS version, be sure to bring bundles, integrated with the designer, regardless of 32-bit system or 64-bit system, it seems to download 32-bit (X86)
Such as:
Otherwise, when you want to add a new database in Visual Studio, there is no sqlite option, and when downloaded correctly and installed, you can see SQLite in VS:
2. Connect to the database
Add Connection--database:db File
2, VS2010 pull a button and DataGridView in the form, implement the Click button, in the DataGridView display the data in the database
private void Button1_Click (object sender, EventArgs e) { using (sqliteconnection con = new Sqliteconnection ( Constants.data_source)) { con. Open (); using (sqlitecommand cmd = new Sqlitecommand ())) { cmd. Connection = con; Cmd.commandtext = string. Format ("select * from jy_cdjy_cdjyhgz"); int rows = cmd. ExecuteNonQuery (); Sqlitedataadapter Orada = new Sqlitedataadapter (cmd); DataSet ds = new DataSet (); Orada.fill (DS); Con. Close (); DataTable dtbl = ds. Tables[0]; This.dataGridView1.DataSource = Dtbl;}} }
Reference:
http://blog.csdn.net/missautumn/article/details/18567715
VS2010 connecting to the SQLite database