예제 #1
0
        public SQLiteCommand(String commandText, SQLiteConnection connection)
            : this(commandText)
        {
            if (connection == null)	throw new ArgumentNullException("Connection is null.");

            Connection = connection;
        }
예제 #2
0
        internal SQLiteTransaction(SQLiteConnection connection)
        {
            _Connection = connection;
            if (_Connection == null) throw new ArgumentNullException("Connection cannot be null.");

            Execute("BEGIN");
        }
예제 #3
0
파일: Form1.cs 프로젝트: evlinsky/FBReader
        private void Form1_Load(object sender, EventArgs e)
        {
            _Connection = new SQLiteConnection("Data Source=test1.db;NewDatabase=True;Synchronous=Off;Encoding=UTF8;Emulator=true");
            _Connection.Open();
            InitializeTables();

            SQLiteCommand cmd = _Connection.CreateCommand();
            cmd.CommandText = "select id, items, customer, amount from orders";

            DataTable table = new DataTable();

            table.Columns.Add("Id");
            table.Columns.Add("Items");
            table.Columns.Add("Customer");
            table.Columns.Add("Amount");

            SQLiteDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                DataRow row = table.NewRow();
                row["Id"] = reader.GetInt32(0);
                row["Items"] = reader.GetInt32(1);
                row["Customer"] = reader.GetString(2);
                row["Amount"] = reader.GetDouble(3);
                table.Rows.Add(row);
            }

            dataGridView1.DataSource = table;
        }
예제 #4
0
파일: Form1.cs 프로젝트: north0808/haina
 private void Form1_Load(object sender, EventArgs e)
 {
     _Connection = new SQLiteConnection("Data Source=\\Program Files\\sqlitetest\\test.db;NewDatabase=True;Synchronous=Off;Encoding=UTF8");
     _Connection.Open();
 }
예제 #5
0
파일: BelugaDb.cs 프로젝트: north0808/haina
 public BelugaDb()
 {
     _Connection = new SQLiteConnection("Data Source=" + DATA_PATH + @"\db\beluga.db;NewDatabase=False;Synchronous=Off;Encoding=UTF8");
 }
예제 #6
0
파일: Form1.cs 프로젝트: evlinsky/FBReader
 private void Form1_Load(object sender, EventArgs e)
 {
     _Connection = new SQLiteConnection("Data Source=c:\\data\\redfivelabs\\temp\\SQLiteTest.sqlite;NewDatabase=True;Synchronous=Off;Encoding=UTF8;Emulator=false");
     _Connection.Open();
 }