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

ÈçºÎÁ´½Óµ½Sql Server 2005


SQL Server 2005
±¾Æª½éÉÜÈçºÎÁ´½Óµ½Sql Server 2005.
²ÉÓÃSQL ±¾µØ¿Í»§ ODBCÇý¶¯
²ÉÓÃSqlÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
ÄãÕýÔÚʹÓÃSQL Server 2005 Express£¿±ðÍü¼ÇÁË£¬ServernameµÄÓï·¨ÊÇServername\SQLEXPRESS£¬Äã¿ÉÒÔÓÃÄã°²×°SQL Server 2005 ExpressµÄÄÇ̨»úÆ÷µÄ»úÆ÷ÃûÌæ´úµôServername
²ÉÓÃwindowsÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;
ÔÚÉÏÃæµÄÓï·¨ÖУ¬"Integrated Security=SSPI" ºÍ "Trusted_Connection=yes"ÊǵÈЧµÄ¡£
¹ØÓÚÊäÈëÓû§ºÍÃÜÂëµÄÌáʾ£º
Ê×ÏÈ£¬Äã±ØÐëÉèÖÃÁ´½Ó¶ÔÏóµÄÌáʾÊôÐÔΪ"adPromptAlways"£¬È»ºóÔÙʹÓÃÁ´½Ó×Ö´®Á´½Óµ½Êý¾Ý¿â¡£
oConn.Properties("Prompt") = adPromptAlways
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
ÔÊÐíMARS£¨¶à¸ö»î¶¯½á¹û¼¯£©
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MARS_Connection=yes
ÔÚÉÏÃæµÄÓï·¨ÖУ¬ "MultipleActiveResultSets=true" ºÍ "MARS_Connection=yes" ÊǵÈЧµÄ ¡£
ҪʹÓÃMARS¹¦ÄÜ£¬±ØÐë°²×°ADO.net 2.0£¬Ado.net 1.0ºÍAdo.net 1.1²»Ö§³ÖMARS¡£
²ÉÓüÓÃÜ·½Ê½·¢Ë͵½ÍøÂç
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes;
¸½¼ÓÊý¾Ý¿âÎļþÖÁÒ»¸ö±¾µØSql Server ExpressʵÀý
Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;
ΪʲôÐèÒªDatabase²ÎÊý£¿Èç¹ûÕâ¸öÊý¾Ý¿âÃûÒѱ»¸½¼Ó¹ý£¬Sql Server Express²»»áÔٴθ½¼ÓÕâ¸öÊý¾Ý¿â£¬Ëü½«Ê¹ÓÃÔ­¸½¼ÓµÄÊý¾Ý¿âÀ´½¨Á¢Á´½Ó¡£
Êý¾Ý¿â¾µÏñ
Èç¹ûÄã²ÉÓÃAdo.net»òSql±¾µØÑéÖ¤·½Ê½Á´½Óµ½Ò»¸ö×÷Ϊ¾µÏñµÄÊý¾Ý¿â£¬µ±Ò»¸ö¾µÏñÊý¾Ý¿â³öÏÖ´íÎóµÄʱºò£¬ÄãµÄÓ¦ÓóÌÐòÄܹ»²ÉÓÃÓÐÀûµÄÇý¶¯×Ô¶¯×ªÏòÁ´½Ó¡£Äã±ØÐëÁ´½Ó×Ö´®ÖÐÖ¸¶¨×î³õµÄÊ×Òª·þÎñÆ÷ºÍÊý¾Ý¿âºÍ¹ÊÕϻָ´·þÎñÆ÷¡£
Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;
ÕâÀï¿ÉÒÔÓÐÐí¶àÖÖÁ´½Ó×Ö´®µÄÊéд·½Ê½À´Á´½ÓÊý¾Ý¿â¾µÏñ¡£ÕâÖ»ÊÇÒ»¸öÖ¸³ö¹ÊÕϻָ´·þÎñÆ÷µÄÀý×Ó£¬Äã¿ÉÒÔºÍÆäËûÁ´½Ó·½Ê½×éºÏÔÚÒ»ÆðʹÓá£
²ÉÓÃOLE DB·½Ê


Ïà¹ØÎĵµ£º

Sql helperʹÓ÷½·¨

    public List<FirmAttachmentModel> LoadFirmAttachmentByFirmId(int FirmId, int pageIndex, int pageSize)
        {
            List<FirmAttachmentModel> result = new List<FirmAtt ......

SQL SERVER¶¨Ê±×÷ÒµµÄÉèÖ÷½·¨

 Èç¹ûÔÚSQL Server ÀïÐèÒª¶¨Ê±»òÕßÿ¸ôÒ»¶Îʱ¼äÖ´ÐÐij¸ö´æ´¢¹ý³Ì»ò3200×Ö·ûÒÔÄÚµÄSQLÓï¾äʱ, ¿ÉÒÔÓùÜÀí->SQL Server´úÀí->×÷ÒµÀ´ÊµÏÖ¡£
¡¡¡¡1¡¢¹ÜÀí->SQL Server´úÀí->×÷Òµ(°´Êó±êÓÒ¼ü)->н¨×÷Òµ
¡¡¡¡2¡¢Ð½¨×÷ÒµÊôÐÔ(³£¹æ)->Ãû³Æ[×Ô¶¨Òå±¾´Î×÷ÒµµÄÃû³Æ]->ÆôÓõķ½¿òÄÚÊǹ´ºÅ->
·ÖÀà´¦¿ ......

Ôõô´Óoracleͨ¹ýodbc ºÍsqlµÃµ½mysql

 oracleµÄodbcÍø¹Ø£¨gateway£©¼¸ºõÌṩһ¸öÎÞÏßµÄÊý¾ÝÕûºÏƽ̨£¬ÔÚoracleºÍÆäËüRDBMSÖ®¼ä£¬ÎÒÔÚÕâ²»Ïë˵ËüµÄ£¬²Ù×÷£¬ÏÞÖÆÒÔ¼°Ïà¹ØÐÔ£¬Ëü½â¾öÁËÒ»¸öСÎÊÌ⣬°ÑËü½¨Á¢ÆðÀ´ÄãÄÜ£¬ÀýÈ磬´´½¨Ò»¸ö database link ÔÚoracle ºÍoracleÖ®¼ä£¬±Ï¾¹£¬ÕâÑù²»ÊǺܺÃô£¬ÀýÈçÄãÄÜÔËÐÐÏÂÃæµÄsqlÓï¾ä£¬
select o.col1, m.col1 from or ......

sqlÌæ»»Óï¾ä

--·Ö½â×Ö·û´®°üº¬µÄÐÅÏ¢ÖµºóÈ»ºóºÏ²¢µ½ÁíÍâÒ»±íµÄÐÅÏ¢
--(°®Ð¾õÂÞ.ع»ª(Ê®°ËÄê·çÓê,ÊصñùɽѩÁ«»¨¿ª)  2007-12-23  ¹ã¶«ÉîÛÚ)
/*ÎÊÌâÃèÊö
tba
ID  classid   name
1     1,2,3   Î÷·þ
2     2,3     ÖÐɽװ
3&n ......

ÈçºÎÓ¦¶ÔWinformsÖÐSQLµÄ×¢Èëʽ¹¥»÷

SqlÓï¾ä×÷Ϊ¹ú¼Ê±ê×¼µÄÊý¾Ý¿â²éѯÓï¾ä£¬±±¾©°á¼Ò¹«Ë¾ ±±¾©Êèͨ¹«Ë¾ÔÚ¸÷ÖÖ±à³Ì»·¾³Öеõ½Á˹㷺µÄÓ¦Óá£×÷Ϊһ¸ö³ÉÊì¡¢Îȶ¨µÄϵͳ£¬Óû§µÇ½ºÍÃÜÂëÑéÖ¤ÊDZز»¿ÉÉٵġ£ÔÚƽʱµÄ±à³Ì¹¤×÷ÖÐÐí¶à³ÌÐòÔ±ÔÚÓÃsqlÓï¾ä½øÐÐÓû§ÃÜÂëÑé֤ʱÊÇͨ¹ýÒ»¸öÀàËÆÕâÑùµÄÓï¾äÀ´ÊµÏֵģº
 strSel = " Select * from Óû§±í where ÐÕÃû= '" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ