·ÀÖ¹sql×¢Èë ÊÊÓÃÓÚ URL ID ´¿Êý×Ö
Àý×Ó£º int id = Convert.ToInt32(replace((Request.QueryString["id"]), ""));
public static string replace(string str, string str2)
{
str = str.Replace(";", str2);
str = str.Replace("&", str2);
str = str.Replace("<", str2);
str = str.Replace(">", str2);
str = str.Replace("'", str2);
str = str.Replace("--", str2);
str = str.Replace("/", str2);
str = str.Replace("%", str2);
str = str.Replace("~", str2);
str = str.Replace(",", str2);
str = str.Replace("`", str2);
str = str.Replace("!", str2);
str = str.Replace("@", str2);
str = str.Replace("#", str2);
str = str.Replace("$", str2);
str = str.Replace("^", str2);
str = str.Replace("*", str2);
str = str.Replace("(", str2);
str = str.Replace(")", str2);
str = str.Replace("+", str2);
str = str.Replace(":", str2);
str = str.Replace("<", str2);
str = str.Replace(">", str2);
str = str.Replace("?", str2);
 
Ïà¹ØÎĵµ£º
SQL×¢Èë¹¥»÷µÄΣº¦ÐԺܴó¡£ÔÚ½²½âÆä·ÀÖ¹°ì·¨Ö®Ç°£¬Êý¾Ý¿â¹ÜÀíÔ±ÓбØÒªÏÈÁ˽âÒ»ÏÂÆä¹¥»÷µÄÔÀí¡£ÕâÓÐÀûÓÚ¹ÜÀíÔ±²ÉÈ¡ÓÐÕë¶ÔÐԵķÀÖδëÊ©¡£
¡¡ Ò»¡¢ SQL×¢Èë¹¥»÷µÄ¼òµ¥Ê¾Àý¡£
¡¡¡¡statement := "SELECT * from Users WHERE Value= " + a_variable + "
ÉÏÃæÕâÌõÓï¾äÊÇºÜÆ ......
¶¨Ò壺
create table ±íÃû£¨ÁÐÃû1 ÀàÐÍ [not null] [,ÁÐÃû2 ÀàÐÍ] [not null]£¬···£© [ÆäËû²ÎÊý]
Ð޸ģº
alter table ±íÃû add ÁÐÃû ÀàÐÍ
alter table ±íÃû rename column ÔÁÐÃû to ÐÂÁÐÃû
alter table ±íÃû alter column ÁÐÃû ÀàÐÍ [£¨¿í¶È£© [£¬Ð¡Êýλ]]
alter table ±íÃû drop column ÁÐÃû
......
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
¡¡¡¡2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database ......
Ò»¡¢³õʼ°²×°ÇëÏȰ²×°sqlserver 2000 ÔÙ°²×°sqlserver 2005
¶þ¡¢Èç¹ûÖÐ;sqlserver2000Óöµ½ÎÊÌâÐèÒªÖØ×°£¬Çë°´ÒÔϲ½Öè
1.ÔÚ¿ØÖÆÃæ°å->Ìí¼Óɾ³ý³ÌÐòÖÐɾ³ýsqlserver2000
2.ÔÚ¹ÜÀí¹¤¾ß->·þÎñÖÐÍ£Ö¹sqlserverµÄËùÓзþÎñ
3.ÊÖ¶¯É¾³ýC:\Program Files\Microsoft SQL ServerĿ¼ÏµÄ80Ŀ¼ºÍMSSQLĿ¼£¨±ØÐëÒªÓеڶþ² ......
c# SQLÊý¾Ý¿âÔ¶³ÌÁ¬½Ó¼°ÅäÖ÷½·¨
Ò»£ºC# Á¬½ÓSQLÊý¾Ý¿â
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Server=myServerAddress;D ......