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

sql×¢Èë

Ê×ÏÈÎÒÏëлл԰×ÓµÄÅóÓÑÃÇ£¬ÊÇÄãÃÇÌáÐÑÎÒдÄÚÈÝÓдíÎ󣬼ǵÃÔø¾­µç×ÓÉÌÎñÖ®Êý¾Ý´æ´¢Á÷³Ì£¨Î壩ÀïÃæ˵µ½“Ñ¡´æ´¢¹ý³Ì+´«µÝ²ÎÊýÓÃSqlParameterÊÇÒòΪ£¬³ý·ÇÊÇADO.NETÓЩ¶´£¬ÄÇô¾Í¾ø¶Ô²»»á·¢ÉúSQL×¢È딡£Keep Walking´ó¸çÒ²ÔÚ¹ØÓÚ·ÀÖ¹sql×¢ÈëµÄ¼¸ÖÖÊֶΣ¨¶þ£©ÖоٳöÀ´Ò»¸öÀý×Ó˵Ã÷ÎÒ˵µÄÉϾ仰ÊÇ´íÎóµÄ¡£ËµÊµ»°µ±Ê±ÎÒ»¹ÊǶÔSQL×¢Èë²»ÊǺÜÁ˽⣬ҲûÓÐÓöµ½¹ýSQL×¢È룬Ҳ²»ÊǺܹØÐÄËü¡£µ«ÊÇÎÒÏ밲ȫµÄÎÊÌâÎÒÃÇÒ»¶¨Òª·Ç³£×¢Ò⣬ÓÚÊÇÕâЩʱºò»¨ÁËһЩʱ¼äÀ´Ñ§Ï°ÁËSQL×¢Èë¡£
ʲôÊÇSQL×¢Èë
¡¡¡¡¿ÉÄÜ´ó¼Ò»¹²»ÊǶÔSQL×¢ÈëÕâ¸ö¸ÅÄî²»ÊǺÜÇå³þ£¬¼òµ¥µØ˵,SQL×¢Èë¾ÍÊǹ¥»÷Õßͨ¹ýÕý³£µÄWEBÒ³Ãæ,°Ñ×Ô¼ºSQL´úÂë´«Èëµ½Ó¦ÓóÌÐòÖÐ,´Ó¶øͨ¹ýÖ´ÐзdzÌÐòÔ±Ô¤ÆÚµÄSQL´úÂë,´ïµ½ÇÔÈ¡Êý¾Ý»òÆÆ»µµÄÄ¿µÄ¡£
¡¡¡¡µ±Ó¦ÓóÌÐòʹÓÃÊäÈëÄÚÈÝÀ´¹¹Ô춯̬SQLÓï¾äÒÔ·ÃÎÊÊý¾Ý¿âʱ£¬»á·¢ÉúSQL×¢Èë¹¥»÷¡£Èç¹û´úÂëʹÓô洢¹ý³Ì£¬¶øÕâЩ´æ´¢¹ý³Ì×÷Ϊ°üº¬Î´É¸Ñ¡µÄÓû§ÊäÈëµÄ×Ö·û´®À´´«µÝ£¬Ò²»á·¢ÉúSQL×¢Èë¡£SQL×¢Èë¿ÉÄܵ¼Ö¹¥»÷ÕßʹÓÃÓ¦ÓóÌÐòµÇ½ÔÚÊý¾Ý¿âÖÐÖ´ÐÐÃüÁî¡£Èç¹ûÓ¦ÓóÌÐòʹÓÃÌØȨ¹ý¸ßµÄÕÊ»§Á¬½Óµ½Êý¾Ý¿â£¬ÕâÖÖÎÊÌâ»á±äµÃºÜÑÏÖØ¡£ÔÚijЩ±íµ¥ÖУ¬Óû§ÊäÈëµÄÄÚÈÝÖ±½ÓÓÃÀ´¹¹Ô죨»òÕßÓ°Ï죩¶¯Ì¬SQLÃüÁ»òÕß×÷Ϊ´æ´¢¹ý³ÌµÄÊäÈë²ÎÊý£¬ÕâЩ±íµ¥ÌرðÈÝÒ×Êܵ½SQL×¢ÈëµÄ¹¥»÷¡£¶øÐí¶àÍøÕ¾³ÌÐòÔÚ±àдʱ£¬Ã»ÓжÔÓû§ÊäÈëµÄºÏ·¨ÐÔ½øÐÐÅжϻòÕß³ÌÐòÖб¾ÉíµÄ±äÁ¿´¦Àí²»µ±£¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£ÕâÑù£¬Óû§¾Í¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯµÄ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃһЩÃô¸ÐµÄÐÅÏ¢»òÕß¿ØÖÆÕû¸ö·þÎñÆ÷£¬ÓÚÊÇSQL×¢Èë¾Í·¢ÉúÁË¡£
Ò»°ãSQL×¢Èë
¡¡¡¡ÔÚWeb Ó¦ÓóÌÐòµÄµÇ¼ÑéÖ¤³ÌÐòÖÐ,Ò»°ãÓÐÓû§Ãû(username) ºÍÃÜÂë(password) Á½¸ö²ÎÊý,³ÌÐò»áͨ¹ýÓû§ËùÌá½»ÊäÈëµÄÓû§ÃûºÍÃÜÂëÀ´Ö´ÐÐÊÚȨ²Ù×÷¡£ÎÒÃÇÓкܶàÈËϲ»¶½«SQLÓï¾äÆ´½ÓÆðÀ´¡£ÀýÈ磺
¡¡¡¡Select * from users where username =’ txtusername.Text ’ and  password =’ txtpassword.Text ’
¡¡¡¡ÆäÔ­ÀíÊÇͨ¹ý²éÕÒusers ±íÖеÄÓû§Ãû(username) ºÍÃÜÂë(password) µÄ½á¹ûÀ´½øÐÐÊÚȨ·ÃÎÊ, ÔÚtxtusername.TextΪmysql£¬txtpassword.TextΪmary£¬ÄÇôSQL²éѯÓï¾ä¾ÍΪ£º
¡¡¡¡Select * from users where username =’ mysql ’ and  password  =’ mary ’
¡¡¡¡Èç¹û·Ö±ð¸øtxtusername.Text ºÍtxtpassword.Text¸³Öµ’ or ‘1’ = ‘1’ --ºÍab


Ïà¹ØÎĵµ£º

¶ÁÈ¡SQL±íÉú³ÉTREEVIEW

Public Function GetDataTable()
Dim myComm As New SqlClient.SqlCommand("SELECT cauth_id,cauth_name,igrade,csupauth_id,csupauth_name from MAIN_TREE01 ", sqlconnection1)
Dim sdapt As New SqlClient.SqlDataAdapter(myComm)
Dim ds As New DataSet
sdapt.Fill(ds)
R ......

ÓÃC++·ÃÎÊSQL Server 2000µÄʵÀý

Ò»¡¢ADO¼ò½é
¡¡¡¡ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ,²»½ö¼òµ¥Ò×Ó㬲¢ÇÒ²»Ê§Áé»îÐÔ.²»Ê§ÎªC++ÀûÓÃÊý¾Ý¿â¿ìËÙ¿ª·¢µÄ²»´íÑ¡Ôñ¡£
¡¡¡¡ÀíÂ۾Ͳ»ÓÃÎÒÔÚÕâ¶ù·Ñ»°ÁË,ÍøÉÏÓкܶà,µ«¹âÊÇÀíÂÛ,Ò²²»ÊDz»¹»µÄ,ADO·ÃÎÊÊý¾ÝµÄ·½·¨ºÜÁé»î,ÈÝÒ×ÈÃÈË»ìÏý.ÍøÉÏ´ó²¿·Ö ......

SQL Server2005 °²×°·½·¨

  µÚÒ»´Î°²×°2005,»¨Á˲»ÉÙ¾«Á¦¡£ËäȻûʲô̫Äѵģ¬µ«ÊDz»ÖªµÀµÄ»°»áºÜ¼¬Êֵġ£Èç¹ûÄãÕýÔÚ°²×°£¬²¢ÇÒ·¢ÏÖÕâƪÎÄÕ£¬ÄÇôÄãºÜ×ßÔË£¬Ä㽫»á˳ÀûµÄ°²×°³É¹¦¡£
    °²×°Ä¿Â¼Öаüº¬Sql Server x64  ºÍ x86,  x86ÊÇ32λ»úÆ÷µÄ¡£x86ÖÐÓÖÓÐtools ºÍ   Servers ¡£µÚÒ»´Î°²×°ÁËServers£¬È» ......

¡¾×ªÔØ.SQL×¢ÈëÔ­Àí¡¿SQL×¢È멶´È«½Ó´¥ ÈëÃÅƪ

Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊ ......

ADO.NETÖеÄsqlÁ¬½Ó

using System.Data;            // Use ADO.NET namespace
using System.Data.SqlClient;  
 SqlConnection thisConnection = new SqlConnection(
      &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ