ASP.NETÁ¬½ÓSQLºÍACCESSµÄ·½·¨
SQL:
using System.Data.SqlClient;
string sql = "server=.;uid=sa;pwd=;database=tablename;";
ACCESS:
using System.Data.OleDb;
string sql = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" + HttpRuntime.AppDomainAppPath + "//App_Data//db.mdb";
HttpRuntime.AppDomainAppPath Ϊ¸ùĿ¼
Ïà¹ØÎĵµ£º
¡¾IT168 ¼¼ÊõÎĵµ¡¿
ĬÈÏÇé¿öÏÂ,SQLServerExpressEdition 2005ºÍSQL Server 2005¿ª·¢°æ²»ÔÊÐíÔ¶³ÌÁ¬½Ó¡£
ÒªÔÊÐíÔ¶³ÌÁ¬½ÓSQL Server 2005 ,ÐèÒªÍê³ÉÒÔϲ½Ö裺
ÔÚSQLServer ʵÀýÉÏÆôÓÃÔ¶³ÌÁ¬½Ó¡£
´ò¿ª·þÎñÆ÷ SQLBrowser ·þÎñ¡£
ÅäÖ÷À»ðǽÒÔÔÊÐíSQLBrowser ·þÎñºÍSQLServer·þ ......
SELECT ID,TITLE,
(SELECT TIMES from CLS_COURSE WHERE CLS_COURSE.ID=CLS_CLASS.COURSEID) AS TIMES,
(SELECT CASE WHEN EXISTS(SELECT * from CLS_ATDC WHERE CLS_ATDC.CLSID=CLS_CLASS.ID ) THEN (SELECT TOP 1 COURSETIME from CLS_ATDC WHERE CLS_ATDC.CLSID=CLS_CLASS.ID ORDER BY COURSETIME DESC) ELSE 0 ......
SQL Server 2008ÆóÒµ°æ. SQL Server 2008ÆóÒµ°æÊÇÒ»¸öÈ«ÃæµÄÊý¾Ý¹ÜÀíºÍÒµÎñÖÇÄÜƽ̨£¬Îª¹Ø¼üÒµÎñÓ¦ÓÃÌṩÁËÆóÒµ¼¶µÄ¿ÉÀ©Õ¹ÐÔ¡¢Êý¾Ý²Ö¿â¡¢°²È«¡¢¸ß¼¶·ÖÎöºÍ±¨±íÖ§³Ö¡£ÕâÒ»°æ±¾½«ÎªÄãÌṩ¸ü¼Ó¼á¹ÌµÄ·þÎñÆ÷ºÍÖ´Ðдó¹æÄ£ÔÚÏßÊÂÎñ´¦Àí¡£
SQL Server 2008±ê×¼°æ. SQL Server 2008±ê×¼°æÊÇÒ»¸öÍêÕûµÄÊý¾Ý¹ÜÀíºÍÒµÎñÖÇÄÜƽ̨£¬Îª²¿ ......
תÔØ˵Ã÷£º¸øÕýÔÚ×öϵͳºÍÏë×öϵͳµÄÈË£¬SQL²©´ó¾«ÉÄãÃÇ»áÓõ½µÄ¡£——mAysWINd
Ò»¸öÌâÄ¿Éæ¼°µ½µÄ50¸öSqlÓï¾ä
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµ ......
--µÚÒ»²½
--ÔÚmaster¿âÖн¨Á¢Ò»¸ö±¸·ÝÊý¾Ý¿âµÄ´æ´¢¹ý³Ì.
USE master
GO
CREATE PROC p
@db_name sysname, --Êý¾Ý¿âÃû
@bk_path NVARCHAR(1024) --±¸·ÝÎļþµÄ·¾¶
A ......