SqliteÔÚC#ÖеÄÓ¦ÓÃ
ÔÚ .NET ÀïÃæʹÓà SQLite£¬ ÎÒÕâÀïʹÓõÄwrapperÊÇ System.Data.SQLite£¬ËüÖ»ÐèÒªÒ»¸ödll,½Ó¿Ú·ûºÏADO.Net 2.0µÄ¶¨Òå,ÐÔÄÜÒ²²»´í,NHibernateÓõÄÒ²ÊÇËü£¬Ä¿Ç°Ö§³ÖADO.NET 3.5ÁË£¬Ö§³Ö¼¯³ÉÔÚ VS2005 ºÍ VS2008ÀïÃ棬¶øÇÒÖ§³Öwince£¬ÊǸöÁÁµã
ÒòΪ·ûºÏADO.NETµÄ¹æ·¶£¬ËùÒÔʹÓ÷½Ê½£¬»ù±¾ºÍ SqlClient, OleDbµÈÔÉúµÄÒ»ÖÂ
using System.Data;
using System.Data.SQLite;
//...
using (SQLiteConnection cn = new SQLiteConnection(
"Data Source=Test.db3;Pooling=true;FailIfMissing=false")
)
//PoolingÉèÖÃΪtrueʱ£¬SQLÁ¬½Ó½«´ÓÁ¬½Ó³Ø»ñµÃ£¬Èç¹ûûÓÐÔòн¨²¢Ìí¼Óµ½Á¬½Ó³ØÖÐ,ĬÈÏÊÇtrue¡£
//FailIfMissingĬÈÏΪfalse£¬Èç¹ûÊý¾Ý¿âÎļþ²»´æÔÚ£¬»á×Ô¶¯´´½¨Ò»¸öеģ¬ÈôÉèÖÃΪtrue£¬½«²»»á´´½¨£¬¶øÊÇÅ׳öÒì³£ÐÅÏ¢¡£
{
//ÔÚ´ò¿ªÊý¾Ý¿âʱ£¬»áÅжÏÊý¾Ý¿âÊÇ·ñ´æÔÚ£¬Èç¹û²»´æÔÚ£¬ÔòÔÚµ±Ç°Ä¿Â¼Ï´´½¨Ò»¸ö
cn.Open();
using (SQLiteCommand cmd = new SQLiteCommand())
{
cmd.Connection = cn;
//½¨Á¢±í£¬Èç¹û±íÒѾ´æÔÚ£¬Ôò±¨´í
cmd.CommandText = "CREATE TABLE [test] (id int, name nvarchar(20))";
cmd.ExecuteNonQuery();
//²åÈë²âÊÔÊý¾Ý
for (int i = 2; i < 5; i++)
{
cmd.CommandText = string.Format("INSERT INTO [test] VALUES ({0}, '¶Å˼²¨¼¼ÊõÌÖÂÛÇøÓò')", i);
cmd.ExecuteNonQuery();
}
for (int i = 5; i < 10; i++)
{
cmd.CommandText = string.Format("INSERT INTO [test] VALUES ({0},
Ïà¹ØÎĵµ£º
³ÃÖÜÄ©ÏëÕÛÌÚÒ»ÏÂǶÈëASP.NETµÄWinForm³ÌÐò
ÐèÒªÓõ½WebBrowser¿Ø¼þµÄHTMLÔ´Âë¶Áд
¾Í°ÑÒÔÇ°µÄһЩ´úÂëƬ¶ÏÒÆÖµµ½C#ÏÂ
˳±ã·¢¸öÌû×Ó±¸Íü£¬ºÇºÇ
˼·ÆäʵºÜ¼òµ¥£¬Ö±½Óͨ¹ýdocument.documentElement.outerHTML
»òÕßʹÓÃIPersistStreamInit½Ó¿ÚÖ±½Ó¶ÔÁ÷½øÐд¦Àí
Ç°ÕßÎҾͲ»·Ï»°ÁË£¬ºóÕßʵÏÖ·½·¨ÈçÏÂ
&nbs ......
C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString( ......
SQl XmlºÍC# XmlÊý¾ÝµÄÒ»µã²Ù×÷×ܽá
ÔÚ´ËÉêÃ÷XmlÊÇInfoSetÊý¾Ý²»ÊÇ×Ö·û´®£¬ËùÒÔÔÚ´ËÇ¿ÁÒ·´¶ÔÓÃstringÆ´½Óxml¡£Êý¾Ý¿â¿ÉÒÔ´æ·ÅxmlÀàÐÍÊý¾Ý£¬ÄÇô¸ÃÊý¾ÝµÄ¾ßÌå²Ù×÷ÓÖÈçºÎÁË¡£
1.Ê×ÏȽ¨Á¢Ò»Õź¬ÓÐxmlÊý¾ÝÀàÐ͵ıí
CREATE TABLE [dbo].[TestXml](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Message] [xml] NULL ......
ÏÂÃæ¸ø³öÁËʹÓÃC# ¿ª·¢µÄÒ»¸öѹËõACCESSÊý¾Ý¿âµÄ³ÌÐò
ÏñFolderBrowserDialog£¨ÓÃÓÚä¯ÀÀÑ¡ÔñÎļþ¼ÐµÄ¶Ô»°¿ò£©¡¢MessageBox£¨ÏûÏ¢´¦Àí¶Ô»°¿ò£©¡¢DirectoryInfo£¨Ä¿Â¼ÐÅÏ¢£¬¿ÉÓÃÓÚ´´½¨¡¢¼ì²âÊÇ·ñ´æÔڵȶÔĿ¼µÄ²Ù×÷£©¡¢FileInfo£¨ÎļþÐÅÏ¢£¬¿ÉÓÃÓÚÎļþµÄ¼ì²â¡¢ÎļþÐÅÏ¢µÄ»ñÈ¡¡¢¸´ÖƵȲÙ×÷£©¡¢DataGridView£¨Êý¾Ý±í¸ñ¿Ø¼þ£¬ÓÃÓ ......