ËѼ¯µÄһЩLINQ to SQLµÄ×ÊÁÏ
MSDN: http://msdn.microsoft.com/en-us/library/bb386976.aspx £¨Ó¢ÎÄ£©
http://msdn.microsoft.com/zh-cn/library/bb386976.aspx £¨ÖÐÎÄ£©
ScottGu µÄLINQ ϵÁУº
Part 1: Introduction to LINQ to SQL
Part 2: Defining our Data Model Classes
Part 3: Querying our Database
Part 4: Updating our Database
Part 5: Binding UI using the ASP:LinqDataSource Control
Part 6: Retrieving Data Using Stored Procedures
Part 7: Updating our Database using Stored Procedures
Part 8: Executing Custom SQL Expressions
Part 9 - Using a Custom LINQ Expression with the <asp:LinqDatasource> control
Ïà¹ØÎĵµ£º
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default \'ĬÈÏÖµ\' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [ ......
¢Ù¡£Æô¶¯Distributed Transaction Coordinator ·þÎñ
´ò¿ª·þÎñ£¬ÔÚ·þÎñÖÐÕÒµ½Distributed Transaction Coordinator·þÎñ£¬Ñ¡Ôñ“ÊôÐÔ”£»
ÔÚ“µÇ¼”Ñ¡ÏÖУ¬Ñ¡Ôñ“´ËÕÊ»§”£¬ÕÊ»§ÃûÌîд“N ......
HibernateÊÇÒ»¿îÓÅÐãµÄORM¹¤¾ß¡£µ«ÊÇÔÚijЩÇé¿öÏÂÄÑÃâ»á¸øÎÒÃǵÄÏîÄ¿´øÀ´Ò»¶¨µÄ¸´ÔÓÐÔ¡£¾ÍËãʹÓÃspring×öÒ»¶¨µÄÊÂÎñ¼ò»¯£¬¸Ä±äµÄÒ²½ö½öÊDZàдµÄʱºò¸ü¼ÓµÄ¼òµ¥¶øÒÑ¡£ÌرðÊÇÔÚ´¦Àí²éѯµÄʱºò£¬hibernateºÍsql±È½ÏÆðÀ´£¬¾ÍËƺõûÓÐÄÇô´óµÄÓÅÊÆÁË¡£ËùÒÔÔںܶàµÄÏîÄ¿ÀïÃæÔÚʹÓÃhibernateºÍspringµÄͬʱ»¹»áʹÓÃibatisµÄsqlmap¡ ......
×î½üÓÉÓÚϵͳµÄÐèÇó£¬ËùÒÔÒªÁ˽âÒ»ÏÂÈçºÎÓÅ»¯sql server£¬ÏÂÃæÊÇÎÒµÄһЩ×ܽᣬ²»×ãµÄµØ·½Ï£Íû´ó¼ÒÅúÆÀÖ¸Õý¡£ËµÒªÓÅ»¯´ó¼ÒÒ»¶¨»áÏëµ½Ë÷Òý£¬ÄÇÎÒÃǾʹÓË÷Òý¿ªÊ¼°É¡£ ΢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý(clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý)ºÍ·Ç¾Û¼¯Ë÷Òý(nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý)£¬ÏÂÃæ ......
ÔÚSQL½á¹¹»¯²éѯÓïÑÔÖУ¬LIKEÓï¾äÓÐ×ÅÖÁ¹ØÖØÒªµÄ×÷Óá£
¡¡¡¡LIKEÓï¾äµÄÓï·¨¸ñʽÊÇ£ºselect * from ±íÃû where ×Ö¶ÎÃû like ¶ÔÓ¦Öµ£¨×Ó´®£©£¬ËüÖ÷ÒªÊÇÕë¶Ô×Ö·ûÐÍ×ֶεģ¬ËüµÄ×÷ÓÃÊÇÔÚÒ»¸ö×Ö·ûÐÍ×Ö¶ÎÁÐÖмìË÷°üº¬¶ÔÓ¦×Ó´®µÄ¡£
¡¡¡¡¼ÙÉèÓÐÒ»¸öÊý¾Ý¿âÖÐÓиö±ítable1£¬ÔÚtable1ÖÐÓÐÁ½¸ö×ֶΣ¬·Ö±ðÊÇnameºÍsex¶þÕßÈ«ÊÇ×Ö·ûÐÍÊý¾ ......