ä¯ÀÀLINQ to SQL¹Øϵ
±êÇ©£ºÊý¾Ý·ÃÎÊ LINQ LINQ to SQL ²¿·Ö
ä¯ÀÀLINQ to SQL¹Øϵ Á½¸ö¹ØÁªµÄ±í£º
½«Á½¸öÓÐÁªÏµµÄ±í¼ÓÈëdbmlÎļþÖУ¬±ÈÈ磺Customers±í ºÍ Orders±í£¬Á½¸ö±íͨ¹ýCustomerIDs½¨Á¢ÁªÏµ£» O/RÉè¼ÆÆ÷»á×Ô¶¯¼ì²âµ½±íÖ®¼äµÄ¹Øϵ£¬ËùÒÔÔÚCustomersÀàÖÐÌí¼ÓÒ»¸öOrders³ÉÔ±£¬À´±íʾ¸Ã¹Øϵ¡£ Àý£º AreslabDataContext aresData = new AreslabDataContext(); var queryResults = from c in aresData.Customers where c.Country =="USA" select new { ID=c.CustomerID,
.....
Ïà¹ØÎĵµ£º
´æ´¢¹ý³ÌgetRecordfromPageµÄÄÚÈÝ
//getRecordfromPage.sql
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[getRecordfromPage]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[getRecordfromPage]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
G ......
Ö÷ÒªÕë¶ÔSQL ServerÊý¾Ý¿âËÀËøÏÖÏóµÄÔ¤·À¼°½â¾ö´ëÊ©½øÐÐÁËÏêϸµÄ½éÉÜ£¬¸ü¶àÄÚÈÝÇë´ó¼Ò²Î¿¼ÏÂÎÄ£º
¡¡¡¡ËÀËøÊÇÖ¸ÔÚij×é×ÊÔ´ÖУ¬Á½¸ö»òÁ½¸öÒÔÉϵÄÏß³ÌÔÚÖ´Ðйý³ÌÖУ¬ÔÚÕù¶áijһ×ÊԴʱ¶øÔì³É»¥ÏàµÈ´ýµÄÏÖÏó£¬ÈôÎÞÍâÁ¦µÄ×÷ÓÃÏÂ,ËüÃǶ¼½«ÎÞ·¨ÍƽøÏÂÈ¥£¬ËÀʱ¾Í¿ÉÄÜ»á²úÉúËÀËø,ÕâЩÓÀÔ¶ÔÚ»¥ÏàµÈ´ýµÄ½ø³Ì³ÆΪËÀËøÏ̡߳£¼òµ¥µ ......
½ñÌìдÍøÕ¾µÄʱºòºÜ囧°¡£¬·¢ÏÖ²éÕÒÓû§È¨ÏÞµÄʱºòÎÞÔµÎ޹ʵÄͬһ¸öȨÏÞÖظ´³öÏֺܶà´Î
Ð޸ĺóµÄSQLÓï¾äÈçÏÂ
SELECT
node
.
id
,
node
.
name
,
access
.
role_id
from
think_role_user
AS
user
,
think_access
AS
access
,
think_node
AS
node
WHERE
user
.
user_id
=
......
1.
ËÀËøÔÀí
¸ù¾Ý²Ù×÷ϵͳÖеĶ¨Ò壺ËÀËøÊÇÖ¸ÔÚÒ»×é½ø³ÌÖеĸ÷¸ö½ø³Ì¾ùÕ¼Óв»»áÊͷŵÄ×ÊÔ´£¬µ«Òò»¥ÏàÉêÇë±»ÆäËû½ø³ÌËùÕ¾Óò»»áÊͷŵÄ×ÊÔ´¶ø´¦ÓÚµÄÒ»ÖÖÓÀ¾ÃµÈ´ý״̬¡£
ËÀËøµÄËĸö±ØÒªÌõ¼þ£º
»¥³âÌõ¼þ
(Mutual exclusion)
£º×ÊÔ´²»Äܱ»¹²Ïí£¬Ö»ÄÜÓÉÒ»¸ö½ø³ÌʹÓá£
ÇëÇóÓë± ......
1¡£°æ±¾£ºSql2008/2005
2¡£Ä¿µÄ£ºµ¼³öÖ¸¶¨µÄ±íÖÐËùÓÐÊý¾Ý£¬µ¼³ö¸ñʽΪ insert Óï¾ä
3¡£¾ßÌå²Ù×÷£º
1£©ÕÒµ½ÐèÒªµ¼³öµÄÊý¾Ý¿â£¬ÓÒ¼ü²Ëµ¥£¬ÈÎÎñ--¡µÉú³É½Å±¾
2£©½øÈëÏòµ¼£¬Ò»Â·ÏÂÒ»²½£¬×¢ÒâÑ¡ÔñÉú³É½Å±¾Ñ¡ÏîµÄʱºò£¬½«“±àдÊý¾ÝµÄ½Å±¾”ÉèÖÃΪ“True”¼´¿É
3£©±£´æÉú³ÉµÄSqlÎļþ ......