问题描述
代码背后代码
private void insertconnect_Click(object sender,EventArgs e)
{
// [snip] - 由于C#纯粹是面向对象的,因此必须将以下行放入类中:
//我们使用这三个SQLite对象:
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;
SQLiteDataReader sqlite_datareader;
sqlite_conn = new SQLiteConnection(); //创建对象的实例
sqlite_conn.ConnectionString =Data Source = c:\\ eminosoft.db; Version = 3; New = True; Compress = True;; //设置ConnectionString
sqlite_conn.Open(); //打开连接。现在你可以触发SQL-Queries
//创建一个新的SQL命令:
sqlite_cmd = sqlite_conn.CreateCommand();
}
code behind code
private void insertconnect_Click(object sender, EventArgs e)
{
// [snip] - As C# is purely object-oriented the following lines must be put into a class:
// We use these three SQLite objects:
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;
SQLiteDataReader sqlite_datareader;
sqlite_conn = new SQLiteConnection(); // Create an instance of the object
sqlite_conn.ConnectionString = "Data Source=c:\\eminosoft.db;Version=3;New=True;Compress=True;"; // Set the ConnectionString
sqlite_conn.Open(); // Open the connection. Now you can fire SQL-Queries
// create a new SQL command:
sqlite_cmd = sqlite_conn.CreateCommand();
}
推荐答案
这篇关于嗨我在这个sqlite中得到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!