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

C# Á¬½Ó Sqlite ÊÂÎñµÄÎÊÌâ

// ´ò¿ªÊý¾Ý¿â
SQLiteConnection dconn = new System.Data.SQLite.SQLiteConnection();
dconn.ConnectionString = @"Data Source=D:\db.sdb";
dconn.Open();
SQLiteCommand dcmd = dconn.CreateCommand();
DbTransaction dtrans = dconn.BeginTransaction();
// Ïòaa±íÖвåÈëÒ»ÌõÊý¾Ý
dcmd.CommandText = "insert into aa (a) values ('000001')";
dcmd.ExecuteNonQuery();
dtrans.Commit();
// Ïòaa±íÖвåÈëµÚ¶þÌõÊý¾Ý
dcmd.CommandText = "insert into aa (a) values ('000002')";
dcmd.ExecuteNonQuery();
dtrans.Commit();//Õâ¶ùÒ»¸öÊÂÎñÖÐÁ½´Îcommit¿É²»¿ÉÒÔ£¬ÎҵĴúÂëÖÐÕâ¸öµØ·½±¨´í
// ·ÅÆú²åÈëµÚÈýÌõÊý¾Ý
dcmd.CommandText = "insert into aa (a) values ('opq')";
dcmd.ExecuteNonQuery();
dtrans.Rollback();//commitºó»¹¿ÉÄÜrollbackÂð£¿Èç¹û¿ÉÒÔ£¬»Øµ½ÄĶùÄØ£¬commitÖ®ºó£¬»¹ÊÇÊÂÎñµÄ¿ªÊ¼´¦
// ¹Ø±ÕÊý¾Ý¿âÁ¬½Ó
dconn.Close();


Á½´¦ºì×Ö¾ÍÊÇÎÒµÄÎÊÌ⣡


ÎÒÏë¶ÔÊý¾Ý·ÖÅú commit ²»ÐÐÂ𣿠²»ÄܳöÏÖ³¬¹ýÒ»¸ö£¿

·­³öÊÂÎñµÄÎÄÕÂÀ´¿´ÁËÏÂÖÕÓÚÓÐÁË´ð°¸ÁË£º

ÊÂÎñÈýÖÖÔËÐÐģʽ£º×Ô¶¯Ìá½»ÊÂÎñÿÌõµ¥¶ÀµÄÓï¾ä¶¼ÊÇÒ»¸öÊÂÎñ¡£ÏÔʽÊÂÎñÿ¸öÊÂÎñ¾ùÒÔ BEGIN TRANSACTION Óï¾äÏÔʽ¿ªÊ¼£¬ÒÔ COMMIT »ò ROLLBACK Óï¾äÏÔʽ½áÊø¡£ÒþÐÔÊÂÎñÔÚÇ°Ò»¸öÊÂÎñÍê³ÉʱÐÂÊÂÎñÒþʽÆô¶¯£¬µ«Ã¿¸öÊÂÎñÈÔÒÔ COMMIT »ò ROLLBACK Óï¾äÏÔʽÍê³É¡£

Õâ˵Ã÷£¬commit»òÕßrollbackÖ®ºóÕâ¸öÊÂÎñ¾ÍÍê³ÉÁË£¬Ö®ºó²»ÄÜÔÙÓÐÈκεÄcommit»òÕßrollbackÁË¡£

°ï


Ïà¹ØÎÊ´ð£º

C# Óï·¨µ¼³öXML µÄ±àÂëÉèÖÃ

ÎÒÏÖÔÚ×ö½Ó¿Úµ¼³ö£¬.NETƽ̨£¬¿ª·¢ÓïÑÔC#£¬Ïëµ¼³öXMLµÄÎı¾¸ñʽ¡£
ÏëµÃµ½ <?xml version="1.0" encoding="GBK"?> 
µÄ±àÂë¸ñʽ£¡ÔõôÉèÖã¿Ð»Ð»£¡¼±£¡
¶¥

Ö»Òª±£´æΪxml¸ñʽ£¬ ......

sqlite ¸ßÊÖ½øÀ´°¡

СµÜ Ūµã¶«Î÷¿ÉÊǵ÷Óà sqlite3_prepare Õâ¸öº¯Êý select ¾ÍºÃʹ Ö»Òª ¸Ä±äÊý¾Ý¿â µÄ¾Í²»ÐÐ ±ÈÈçinsert Ö®ÀàµÄ Ë­À´°ï¸öæ°¡ ÇëÎÊÕâÊÇʲôԭÒò °¡ Óà c ȥʵÏÖµÄ
ÄãÓõÄʲô¹¤¾ß°¡?
°ÑÄã×Ô¼ºµÄ´úÂë·¢ ......

C# ÖÐ ÈçºÎʵÏÖ ¹öÆÁЧ¹û - .NET¼¼Êõ / C#

ÎÒÏëÓÃc#×öÒ»¸öС˵ÔĶÁÆ÷ µ«²»ÖªÈçºÎʵÏÖÄÇ×Ô¶¯¹öÆÁЧ¹û ÄÄλ¸ßÊÖÄÜ°ïæ½â¾öһϠлл£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡
°ïÄ㶥¶¥£¬ÆÚ´ý¸ßÊÖ°ïæ½â¾ö

(1)Timer
(2)textBox1.ScrollToCaret();
......

C# ²ËÄñ¼ÌÐøÌáÎÊ£¡ - .NET¼¼Êõ / C#

×ö¸öС¶«Î÷£¬ÔËÐйý³ÌÖлáµÃµ½Ò»¸öintÊý¾Ý£¬ÎÒÏë°ÑÕâ¸öÊý¾ÝÁí´æΪÎÊÌ⣬Ï´θóÌÐòÔÙÔËÐÐʱ¿ÉÒÔʹÓã¡XML,TXTµÈ¶¼ÐУ¡ÔõôÉú³É£¬Éú³ÉÁËÔõô¸üУ¬Ôõô¶ÁÈ¡£¡Ïà¶Ô·¾¶£¡
Äã·Åµ½±¾µØµÄÒ»¸ötxtÎļþÀ³ÌÐò¹Ø±Õʱ°Ñ¸ÃÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ