.NETѧϰÊÖ¼ÇÖ®£ºlinq to SQL(Ò»)
Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÏȽ¨Ò»¸öC#Àࣺ
ÒýÓÃSystem.Data.Linq.dll³ÌÐò¼¯£¬
using System.Data.Linq.MappingºÍ
using System.Data.Linq Á½¸ö¿Õ¼ä¡£
[Table]
public class Inventory
{
[Column]
public string Make;
[Column]
public string Color;
[Column]
public string PetName;
//Ö¸Ã÷Ö÷¼ü¡£
[Column(IsPrimaryKey = true)]
public int CarID;
public override string ToString()
{
return string.Format(
"±àºÅ={0};ÖÆÔìÉÌ={1};ÑÕÉ«={2};°®³Æ={3}",
CarID,Make.Trim(),Color.Trim(),PetName.Trim());
}
}
ÓëSQL(express°æ)Êý¾Ý¿â½»»¥:
class Program
{
const string cnStr=
@"Data Source=(local)\SQLEXPRESS;Initial Catalog=Autolot;"+
"Integrated Security=True";
static void Main(string[] args)
{
Console.WriteLine("*****LINQ to SQL ¼òµ¥Ó¦ÓÃ*****");
//´´½¨Ò»¸öDataContext¶ÔÏó¡£
DataContext db= new DataContext(cnStr);
//´´½¨Ò»¸öTable<>·ºÐÍʵÀý¡£
Table<Inventory> invTable = db.GetTable<Inventory>();
//ÓÃÒ»¸öLINQ²éѯÏÔʾ½á¹û¡£
foreach(var car in from c in invTable select c)
Console.WriteLine(car.ToString());
}
Console.ReadLine();
}
¶ÔDataContextÀà½øÐÐÀ©Õ¹£º
class MyAutoLotDatabase:DataContext
{
public Table<Inventory> Inventory;
public MyAut
Ïà¹ØÎĵµ£º
SQLÊý¾Ý¿âÖÐÓÃimageÀ´´æ´¢Îļþ,µ«SQLûÓÐÌṩֱ½ÓµÄ´æÈ¡ÎļþµÄÃüÁî.
/*--bcp ʵÏÖ¶þ½øÖÆÎļþµÄµ¼Èëµ¼³ö
Ö§³Öimage,text,ntext×ֶεĵ¼Èë/µ¼³ö
imageÊʺÏÓÚ¶þ½øÖÆÎļþ,°üÀ¨:WordÎĵµ,ExcelÎĵµ,ͼƬ,ÒôÀÖµÈ
text,ntextÊʺÏÓÚÎı¾Êý¾ÝÎļþ
×¢Òâ:µ¼Èëʱ,½«¸²¸ÇÂú×ãÌõ¼þµÄËùÓÐÐÐ
µ¼³öʱ,½ ......
簡體數據庫轉·±體數據庫µÄ問題 °ÝÍÐÁË
ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE DatabaseName COLLATE Chinese_Taiwan_Stroke_CI_AS
ALTER DATABASE DatabaseName SET MULTI_USER WITH ROLLBACK ......
use Master
go
if object_id('SP_SQL') is not null
drop proc SP_SQL
go
create proc [dbo].[SP_SQL](@ObjectName sysname)
as
set nocount on ;
declare @Print varchar(max)
if exists(select 1 from syscomments where ID=objec ......
PL/SQLʵÀý·ÖÎö
µÚÎåÕÂ
1¡¢PL/SQLʵÀý·ÖÎö
1£©ÔÚ¡¾SQLPlus Worksheet¡¿ÖÐÖ±½ÓÖ´ÐÐÈçÏÂSQL´úÂëÍê³ÉÉÏÊö²Ù×÷¡£(´´½¨±í)
¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D¨D
CREATE TABLE "SCOTT"."TESTTABLE" ("RECORDNUMBER" NUMBER(4) NOT NULL, "CURRENTDATE" DATE NOT NULL)
TABLESPACE "SYSTEM ......
¾¡Á¿ÉÙÓÃIN²Ù×÷·û£¬»ù±¾ÉÏËùÓеÄIN²Ù×÷·û¶¼¿ÉÒÔÓÃEXISTS´úÌæ¡£
²»ÓÃNOT IN²Ù×÷·û£¬¿ÉÒÔÓÃNOT EXISTS»òÕßÍâÁ¬½Ó+Ìæ´ú¡£
OracleÔÚÖ´ÐÐIN×Ó²éѯʱ£¬Ê×ÏÈÖ´ÐÐ×Ó²éѯ£¬½«²éѯ½á¹û·ÅÈëÁÙʱ±íÔÙÖ´ÐÐÖ÷²éѯ¡£¶øEXISTÔòÊÇÊ×Ïȼì²éÖ÷²éѯ£¬È»ºóÔËÐÐ×Ó²éѯֱµ½ÕÒµ½µÚÒ»¸öÆ¥ÅäÏî¡£NOT EXISTS±ÈNOT INЧÂÊÉԸߡ£µ«¾ßÌåÔÚÑ¡ÔñIN»òEXIST² ......