ZZʹÓÃSQL Server´æ´¢ASP.NET Session±äÁ¿
´´½¨ºÍÅäÖÃASP.NET Session״̬Êý¾Ý¿â
ÔÚ»ùÓÚNLB£¨ÍøÂ縺ÔØƽºâ£©»·¾³ÏµÄASP.NET WebÓ¦ÓóÌÐò¿ª·¢£¬ÎÒÃÇÐèÒª½«Session´æ´¢ÔÚÊý¾Ý¿âÖ驶à¸öWebÓ¦ÓóÌÐòµ÷Óã¬ÒÔÏÂΪÅäÖ÷½·¨¼°×¢ÒâÊÂÏî¡£
1.´´½¨ÓÃÓÚ´æ´¢ASP.NET SessionµÄÊý¾Ý¿â£¨Ô¶³Ì¡¢±¾µØ½Ô¿É£¬Ê¹ÓÃÊý¾Ý¿âÓû§Éí·ÝÈÏÖ¤£©
ÔÚWindows\Microsoft.NET\Framework/V2.0.50727Ŀ¼ÏÂʹÓÃÈçÏÂÃüÁ
aspnet_regsql.exe -S <SQL Server IP> -U <User Name> -P <Password> -E -ssadd -sstype c -d <Database Name>
ÃüÁîÖ´Ðкó¾Í»á³É¹¦½¨Á¢ÆðÓÃÓÚ´æ´¢ASP.NET Session±äÁ¿µÄÊý¾Ý¿âÁË¡£
2.Web.ConfigÎļþÅäÖÃÏî
ÎÒÃÇÐèÒªÔÚASP.NET WebÓ¦ÓóÌÐòÖеÄWeb.ConfigÎļþÐÞ¸ÄsessionStateÅäÖÃÏîÒÔʹSession״̬Êý¾Ý¿âÉúЧ¡£
ÅäÖýڵãÈçÏ£º
<sessionState mode="SQLServer"
sqlConnectionString="server=<Server IP>;database=<Database Name>;uid=<User Name>;pwd=<Password>;"
allowCustomSqlDatabase="True"
cookieless="false"
timeout="20" />
3.×¢ÒâÔÚ½øÐÐϵͳ²âÊÔ£¨Ö÷ÒªÊǸºÔزâÊÔ£©µÄʱºò£¬ÒòΪÊý¾Ý¿â·ÃÎʸºÔصÄÔö¼Ó£¬ÐèÒªµ÷ÕûSQL ServerÏàÓ¦³¬Ê±µÄÅäÖÃÏîÒÔÊÊÓ¦¸ºÔØ¡££¨Ä¬ÈÏֵΪ10£¬ÇëÊʶȽøÐе÷Õû¡££©
ASP.NET Session״̬Êý¾Ý¿âÊý¾ÝÄ£ÐÍ
1.ASPStateTempSessions±í¶¨Òå
ÁÐÃûÀàÐÍÃèÊö
SessionId
nvarchar(88)
Session ID + application ID
Created
datetime
Date and time session was created (UTC)
Expires
datetime
Date and time session expires (UTC)
LockDate
datetime
UTC date and time session was locked
LockDateLocal
datetime
Local date and time session was locked
LockCookie
int
Lock ID
Timeout
int
Session timeout in minutes
Locked
bit
1=Session locked, 0=Session not locked
SessionItemShort
varbinary(7000)
Serialized session state (if <= 7,000 bytes)
SessionItemLong
image
Serialized session state (if > 7,000 bytes)
Flags
int
Session state flags (1=Uninitialized session)
2.ASPStateTempApplications±í¶¨Òå
ÁÐÃûÀàÐ
Ïà¹ØÎĵµ£º
SQL Server 2005
±¾Æª½éÉÜÈçºÎÁ´½Óµ½Sql Server 2005.
²ÉÓÃSQL ±¾µØ¿Í»§ ODBCÇý¶¯
²ÉÓÃSqlÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
ÄãÕýÔÚʹÓÃSQL Server 2005 Express£¿±ðÍü¼ÇÁË£¬ServernameµÄÓï·¨ÊÇServername\SQLEXPRESS£¬Äã¿ÉÒÔÓÃÄã°²× ......
ÖÕÓڸ㶨JSPÁ¬½ÓSQL Server 2000Êý¾Ý¿âµÄÎÊÌâÁË
2008Äê01ÔÂ29ÈÕ ÐÇÆÚ¶þ 15:54
Ç°¼¸Ì죬ƽƽͬѧһֱÔÚ¸ãJSP Á¬½ÓSQL Server 2000Êý¾Ý¿âµÄÎÊÌ⣬һֱÁ¬²»ÉÏ£¬È»ºó½ÐÎÒÈ¥°ïËû¿´¿´£¬Æ¾×ÅÒÔÇ°µÄ¾Ñ飬¸ãÁËÒ»¸öÏÂÎ磬ºÙºÙ£¡ÖÕÓÚ°ïËûÁ¬½ÓÉÏÁË£¬Ö÷Òª²½ÖèÈçÏ£º
1¡¢ÐèÒªµÄ¶«Î÷´ó¼Ò¿ÉÒÔµ½Î ......
¸ø´ó¼Ò¸öѧϰÊý¾Ý¿âµÄÈí¼þ°É£¬sql server 2008£¬Õâ¸öÊÇ΢Èí¹«Ë¾µÄ×÷Æ·£¬²»´í£¬Ó¦¸ÃÊǷdz£²»´í£¬ÔÚµçÄÔÉÏ°²×°OracleÊý¾Ý¿âµÄ»°£¬ÄǸö±È½Ï´ó£¬¶øÇÒÔÚÍøÉÏÒ²²»ºÃÏÂÔØ£¬ÒªÊÇÁ¬½Óµ½Ñ§Ð£·þÎñÆ÷µÄ»°£¬Ò²ÊDz»¿ÉÄܵģ¬³ý·Ç´ó¼Ò¾³£È¥»ú·¿ÉÏ»ú£¬µ«ÊÇÄǸöÒ²²»¿ª£¬·Ï»°²»¶à˵ÁË£¬´ó¼Òȥ΢Èí¹ÙÍøÏÂÔØÒ»¸ösql server 2008µÄÊÔÓðæµÄ°²×°ÎÄ ......
<%
set conn= server.createobject("ADODB.connection")
conn.open "driver={sybase driver 10};"
"srvr=SYBASE;"
"UID=sa;"
"pwd=sybase;"
sql="select no from tab_st ......
DateTime dt = DateTime.Now;
// Label1.Text = dt.ToString();//2005-11-5 13:21:25
// Label2.Text = dt.ToFileTime().ToString();//127756416859912816
// Label3.Text = dt.ToFileTimeUtc().ToString();//127756704859912816
// Label4.Text = dt.ToLocalTime().ToString();//2005-11-5 21:21:25
// Label5.Text = ......