Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ôõô»ñÈ¡sqlserver×îºó²åÈëÐÐÄÚµÄ×ֶΣ¿

Ö÷¼üÊÇuniqueidentifierÀàÐÍ£¬Ã»ÓÐ×ÔÔö×ֶΡ£¡£

ÕâÑùÓ¦¸ÃÔõô»ñÈ¡£¿


L@_@K
SQL code:
SELECT ISNULL(SCOPE_IDENTITY(), -1) AS [SCOPE_IDENTITY]


°´Ê±¼äÅÅÐò
»ò
guid²»Òª×Ô¶¯Éú³É
ÔÚÌí¼ÓµÄʱºò ÔÚ´úÂëÀïн¨Ò»¸öguid


µ¹ÐðÈ¡×îºóµÄÒ»Ìõ¼Ç¼

¹Ø×¢

ÒýÓÃ
µ¹ÐðÈ¡×îºóµÄÒ»Ìõ¼Ç¼

ÔõôŪ£¿¾ßÌåµã¡£¡£

SQL code:
SELECT ISNULL(SCOPE_IDENTITY(), -1) AS [SCOPE_IDENTITY]

Õâ¸öËƺõ²»Ðа¡¡£¡£

ÒýÓÃ
°´Ê±¼äÅÅÐò
»ò
guid²»Òª×Ô¶¯Éú³É
ÔÚÌí¼ÓµÄʱºò ÔÚ´úÂëÀïн¨Ò»¸öguid


¶÷  ÎÒÏÖÔÚÏ£ÍûinsertÍêºó·µ»ØÕâ¸öguid £¨´æ´¢¹ý³ÌÀ
µ«ÊDzåÈëÍêÓÃʱ¼äselect²»µ½¸Õ²åÈëµÄ£¬Õâ¸öÎÊÌâÔõô´¦Àí£¿

À´Ñ§Ï°Ñ§Ï°~   

°Ñ±íÔö¼ÓÒ»¸ö×ÔÔö×ֶβ»¾ÍºÃ°ìÁËÂð ±íÉè¼ÆÎÊÌâ

ͬÒâÂ¥ÉÏ£¬

Ï°¹ßÐÔ½«±í¼ÓÉÏÒ»¸ö×ÔÔö ID, ×÷ΪΨһ±êʶ£¬ÊÇÒ»¸öºÃÏ°¹ß¡£

Ö÷¼ü¿ÉÒÔ¶à¸ö

ͬͬͬ¥ÉÏ,SELECT * from table WHERE Id = @@IDENTITY


Ïà¹ØÎÊ´ð£º

jsp jdbcÁ¬½Ósqlserver 2000 ³öÏÖÎÊÌâ

´úÂ룺

try{
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 
con= DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost: ......

°ÑÒ»¸ösqlserverÌáÈ¡µÄdataset²åÈëµ½sqlce

Êý¾Ý10WÌõÒÔÉÏ,wm6.5ƽ̨,ÄÚ´æÓÐÏÞ

C# code:
private void connserver()
{

Cursor.Current = Cursors.WaitCursor;
try
{
......

sqlserver jdbc driverÇý¶¯ÄÄÀïÕÒ

ÎÒ´Ó΢Èí¹ÙÍøÏÂÔصÄdriverÔõôÊǸöhtmlÎļþË­¸øÖ¸Õýһϣ¬ÔÚÄÄÀïÏ£¬¾ßÌå·¾¶¼°²Ù×÷²½Öè
Ò»°ã¹ÜÍøÏÂÔض¼ÒªÒ»²½Ò»²½×ßÏÂÈ¥£¬Èç¹ûÄã¹ýÔçÁí´æΪµÄ»°£¬µÃµ½µÄÍùÍùÊÇlicenseÄÇÒ»Ò³¡£

ÎҼǵĺÃÏëÔÚ£ºÄãϵÄÄǸöHTMLÎļ ......

vs Á¬½Ó sqlserver ²åÈëÊý¾Ý´úÂë¡¢¡¢¡¢¡¢¡¢Çó¾È

C# code:

//Ôö¼ÓÒ»ÌõÊý¾Ý¡£¡£¡£¡£¡£
public int AddAdmin(string UID, string PWD)
{
string sql = "insert into Admin(_uid,_pwd)values(@UID,@PWD)";
SqlParameter[] p ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ