asp.net´Ósql server2005ÖвéѯÊý¾Ý
Ê×ÏÈÒªÌí¼Ó
using System.Data;
using System.Data.SqlClient;
½ÓÏÂÀ´£º
SqlConnection conn = new SqlConnection("server=QLPC\\SQL2005;uid=sa;pwd=£¨ÄãµÄÃÜÂ룩;database=£¨ÄãµÄÊý¾Ý±í£©"); //ÓÃÓÚÁ¬½ÓÊý¾Ý¿â
conn.Open(); //´ò¿ªÊý¾Ý¿â
SqlCommand cmd = new SqlCommand("select * from [user]", conn); //Ï൱ÓÚÖ´ÐÐÊý¾ÝÓï¾ä°É
SqlDataReader read = cmd.ExecuteReader(); //´´½¨Ò»¸öSqlDataReaderµÄreadÏó
while (read.Read()) //µ±¶ÁÈ¡µÄÊý¾Ý´æÔÚʱÔòд³öÀ´
{
Response.Write(read[0]);
}
conn.close(); //¹Ø±ÕÊý¾Ý¿âµÄÁ´½Ó
Ïà¹ØÎĵµ£º
1. SET DEADLOCK_PRIORITY
˵Ã÷£º¿ØÖÆÔÚ·¢ÉúËÀËøÇé¿öʱ»á»°µÄ·´Ó¦·½Ê½¡£Èç¹ûÁ½¸ö½ø³Ì¶¼Ëø¶¨Êý¾Ý£¬²¢ÇÒÖ±µ½ÆäËü½ø³ÌÊÍ·Å×Ô¼ºµÄËøʱ£¬Ã¿¸ö½ø³Ì²ÅÄÜÊÍ·Å×Ô¼ºµÄËø£¬¼´·¢ÉúËÀËøÇé¿ö¡£
Óï·¨£ºSET DEADLOCK_PRIORITY { LOW | NORMAL | @deadlock_var }
²ÎÊý£ºLOW   ......
asp.net ͼƬÊý¾Ý¿â´æ´¢Ïê½â£¨Àý×ÓÍêÕû°æ£©
asp.net ͼƬÊý¾Ý¿â´æ´¢Ïê½â£¨Àý×ÓÍêÕû°æ£©
°´ÕÕÒÔϵijÌÐò´úÂ룬¾¹ý±¾ÈËÔÚvs2005ÉϵIJâÊÔ£¬ÐÞ¸Äʵ¼Ê¿ÉÒÔÔËÐеĴúÂëÈçÏ£º
6¸öÎļþ
ÊÇÔÚÒ»¸ö·¢²¼¸ùĿ¼ÏµÄtestÎļþ¼ÐÖвâÊÔͨ¹ýµÄ¡£
SQL½Å±¾ÈçÏ£º
CREATE TABLE [dbo].[image] (
[image_id] [bigint] IDENTITY ......
ΪʲôҪ״̬¹ÜÀí
B/SÓëC/SÁ½Öּܹ¹µÄÓÐ×ÅÍêÈ«²»Í¬µÄÔËÐлúÖÆ¡£C/S»ù±¾ÉÏËùÓеÄÈí¼þ¹¦Äܶ¼ÔÚ¿Í»§¶Ë(Client)ÖÐʵÏÖ£¨ËùÒÔC/SÒ²³ÆΪÅÖ¿Í»§¶Ë¼Ü¹¹£©£¬·þÎñÆ÷¶Ë(Server)Ö»Ìṩ»ù´¡·þÎñ£¬×îΪµäÐ͵ÄÊÇÊý¾Ý¿â·þÎñÌṩÊý¾Ý·þÎñ¡£¶øB/S¼Ü¹¹Ö÷ÒªµÄ¹¦ÄÜÔÚ·þÎñ¶Ë(Server)ʵÏÖ£¬¿Í»§¶ËµÄä¯ÀÀÆ÷( ......
Asp.net ÖÐÔÚ¿Í»§¶Ë´¥·¢·þÎñÆ÷¶Ëʼþ·ÖΪÁ½ÖÖÇé¿ö£º
Ò». WebControlsÖеÄButton ºÍHtmlControlsÖеÄTypeΪsubmitµÄHtmlInputButton
ÕâÁ½ÖÖ°´Å¥×îÖÕµ½¿Í»§¶ËµÄ±íÏÖÐÎʽΪ£º<input type="submit" value="Submit">£¬ÕâÊÇForm±íµ¥µÄÌá½»°´Å¥£¬µã»÷ÒÔºó»á×÷Ϊ²ÎÊý·¢Ë͵½·þÎñ¶Ë£¬²ÎÊýÊÇÕâÑùµÄ£º
¿Ø¼ ......
ASP.NETµÄÒ³Ãæ³õʼ»¯ÓëʼþÏê½â
Ò»¡¢³õʼ»¯
¡¡¡¡·µ±Ò³Ãæ±»Ìá½»ÇëÇóµÚÒ»¸ö·½·¨ÓÀÔ¶Êǹ¹Ô캯Êý¡£Äú¿ÉÒÔÔÚ¹¹Ô캯ÊýÀïÃæ³õʼһЩ×Ô¶¨ÒåÊôÐÔ»ò¶ÔÏ󣬲»¹ýÕâʱºòÒòΪҳÃ滹ûÓб»ÍêÈ«³õʼ»¯ËùÒÔ¶àÉÙ»áÓÐЩÏÞÖÆ¡£ÌرðµØ£¬ÄúÐèҪʹÓÃHttpContext¶ÔÏó¡£µ±Ç°¿ÉÒÔʹÓõĶÔÏó°üÀ¨QueryString, FormÒÔ¼°Cookies¼¯ºÏ£ ......