Ò»²½Ò»²½Ñ§Linq to sql£¨ËÄ£©£º²éѯ¾ä·¨
select
ÃèÊö£º²éѯ¹Ë¿ÍµÄ¹«Ë¾Ãû¡¢µØÖ·ÐÅÏ¢
²éѯ¾ä·¨£º
var ¹¹½¨ÄäÃûÀàÐÍ1 = from c in ctx.Customers
select new
{
¹«Ë¾Ãû = c.CompanyName,
µØÖ· = c.Address
};
¶ÔÓ¦SQL£º
SELECT [t0].[CompanyName], [t0].[Address]
from [dbo].[Customers] AS [t0]
ÃèÊö£º²éѯְԱµÄÐÕÃûºÍ¹ÍÓÃÄê·Ý
²éѯ¾ä·¨£º
var ¹¹½¨ÄäÃûÀàÐÍ2 = from emp in ctx.Employees
select new
{
ÐÕÃû = emp.LastName + emp.FirstName,
¹ÍÓÃÄê = emp.HireDate.Value.Year
};
¶ÔÓ¦SQL£º
SELECT [t0
Ïà¹ØÎĵµ£º
ʹÓû·¾³£ºWinxp£¬Mssql 2000 ¸öÈË°æ
¡¡¡¡1¡¢´ò¿ªÄãµÄ±¾µØMssqlÆóÒµ¹ÜÀíÆ÷£¬Õ¹¿ª¿ØÖÆ̨¸ùĿ¼¡¢Microsoft SQL Server¡¢SQL Server×顣ĬÈÏ°²×°ºÃµÄMssql×éÖÐÖ»ÓÐÒ»¸öLocal£¨Windows NT£©¡£×¢Ò⣬ÔÚWin 2000ÖÐÏÔʾµÄÊDZ¾µØ¼ÆËã»úÃû¡£
¡¡¡¡2¡¢Êó±êÓÒ¼üSQL Server×飬ѡÔñн¨SQL Server×¢²áÃüÁµ¯³ö×¢²áÏòµ¼¡£
¡¡¡ ......
SQLÖÐWHERE×Ó¾äÖпÉÒÔÀûÓÃLIKEÀ´Æ¥ÅäÏàËƵÄÊý¾ÝÏµ±Ê±Îҵõ½µÄ½áÂÛÊÇ¿ÉÒÔʹÓÃ"%"À´Æ¥Åä×Ö·û´®£¬ÔÚSPUFIÖÐʹÓ㬵ÄÈ·¿ÉÒԵõ½×Ö·û´®Æ¥ÅäµÄЧ¹û¡£È磺
SELECT * from TEST
WHERE TESTID LIKE "CZX%";
ÉÏÃæÕâ¾äÔÚSPUFIÖÐÌ ......
USE master
GO
DECLARE @dbname sysname
SET @dbname='TEST' --Õâ¸öÊÇҪɾ³ýµÄÊý¾Ý¿â¿âÃû
DECLARE @s NVARCHAR(1000)
DECLARE tb CURSOR local FOR
SELECT s='KILL '+CAST(spid AS NVARCHAR)&nbs ......
ºǫ́Êý¾Ý¿â£º
[Microsoft Access]
Óë
[Microsoft Sql Server]
¸ü»»Ö®ºó£¬ASP´úÂëӦעÒâÒªÐ޸ĵÄһЩµØ·½£º
[Ò»]Á¬½ÓÎÊÌ⣨¾ÙÀý)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATA ......