Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#ÓëSqliteÊý¾Ý¿â²Ù×÷ʵÀý

ÕâÊÇÒ»¸öÓйطÖÒ³µÄʵÀý,½ö¹©²Î¿¼(´úÂëÀ´×ÔÍøÂç)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;
using System.Threading;
using System.Collections;
using System.IO;
namespace ReadCardDemo
{
public partial class Form3 : Form
{
Form4 form4 = new Form4();
int pageSize = 12; //ÿҳÏÔʾÐÐÊý
int nMax = 0; //×ܼǼÊý
int totalPage = 0; //×ÜÒ³Êý£½×ܼǼÊý/ÿҳÏÔʾÐÐÊý
int currentPage = 1; //µ±Ç°Ò³ºÅ
int pageCount = 0; //µ±Ç°Ò³ÊýµÄ¼Ç¼Êý
int selectRow; //µ±Ç°Ñ¡ÖеÄÐÐÊý
DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable();
SQLiteDataAdapter dataAdapter;
SQLiteConnection conn = new SQLiteConnection();
SQLiteCommand cmd;
SQLiteDataReader dr;
string datasource;
string _sql;
public Form3()
{
InitializeComponent();
}
//³õʼ»¯Êý¾Ý
public void InitializeDataSource()
{
dataTable.Clear();
dataTable.AcceptChanges();
//´´½¨Êý¾Ý¿â
//datasource = "/Windows/ReadCardDemo/PersonId.db";
//SQLiteConnection.CreateFile(datasource);
//½¨Á¢Êý¾Ý¿âÁ¬½Ó
datasource = @"Data Source=/Windows/ReadCardDemo/PersonId.db";
conn.ConnectionString = datasource;
//»ñÈ¡µ±Ç°Êý¾Ý¿âµÄ¼Ç¼Êý
_sql = "select count(*) from PersonId";
conn.Open();
cmd = new SQLiteCommand(_sql, conn);
dr = cmd.ExecuteReader();
while (dr.Read())
{
try
{
nMax = Convert.ToInt32(dr.GetValue(0));
}
catch(Exception e)
{


Ïà¹ØÎĵµ£º

SQLiteµÄ¾ÖÏÞÐÔ

SQL-92ÌØÐÔ·½Ãæ
ÕýÈçÇ°ÃæÌáµ½µÄ£¬SQLite²»Ö§³ÖSQL-92µÄÔںܶàÆóÒµÊý¾Ý¿âϵͳÖпÉÓõÄһЩÌØÐÔ¡£
È磺
Íâ¼üÔ¼Êø£¨¿É½âÎöµÄ£¬µ«·ÇÇ¿ÖÆ£©
ºÜ¶àALTER TABLEÌØÐÔ
һЩTRIGGERÏà¹ØµÄÌØÐÔ
RIGHTºÍFULL OUTER JOIN
¸üÐÂÒ»¸öVIEW
GRANTºÍREVOKE
Äã¿ÉÒÔÔÚSQLiteµÄÖ÷Ò³ÉÏ»ñÈ¡×îÐÂÐÅÏ¢¡£
http://www.sqlite.org/omitted.html ......

ÎÒÃÇÒ»Æðѧϰ sqlite µÄÓ¦ÓÃ


                                                       ......

SqliteÖÐÎÄÅÅÐòÑо¿

תÔØʱÇë×¢Ã÷³ö´¦ºÍ×÷ÕßÁªÏµ·½Ê½£ºhttp://blog.csdn.net/absurd
×÷ÕßÁªÏµ·½Ê½£ºLi XianJing <xianjimli at hotmail dot com>
¸üÐÂʱ¼ä£º2006-12-19
SqliteÊÇÒ»¸öÓÃCÓïÑÔʵÏÖµÄСÐÍSQLÊý¾Ý¿âÒýÇæ¡£ËüÌå»ýСÇɵ«¹¦ÄÜÇ¿´ó£¬¶ÔÓ²¼þ×ÊÔ´ÒªÇóºÜµÍ¶øÇÒÐÔÄܱíÏÖ׿Խ£¬·Ç³£ÊʺÏÓÚǶÈëʽӦÓû·¾³¡£×î½ü·¢ÏÖsqlite²¢²»Ö§³ÖÖÐÎ ......

SqliteÅжÏ×ֶδæÔÚ

Åжϱí´æÔڵķ½·¨ºÜ¼òµ¥,ÍøÉϺܶà:
SELECT COUNT(*) from sqlite_master where type='table' and name='%s'" % tname;
ÄÇôÅжÏ×Ö¶ÎÊÇ·ñ´æÔÚ, »òÕß˵ÈçºÎÅжϱíµÄ°æ±¾ÊÇ·ñ×îоÍÖ»ÐèÒª:
select * from sqlite_master where tbl_name='tblContactList';
sqlite_master µÄ±í½á¹¹ÈçÏÂ:
type   |name  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ