C#×Ô¶¯Êý¾Ý¿â´úÂëÉú³ÉµÄ˼·
C#²Ù×÷Êý¾Ý¿â£¬Ð´À´Ð´È¥¾ÍÄÇô¼¸¾äÌ×»°£¬·³¡£¾¡¹ÜÓÐSqlHelperÖ®ÀàµÄ¸¨ÖúÀ࣬µ«»¹ÊÇÓÐÒ»¶Ñ²ÎÊýÒª×Ô¼ºÌ¼ÌÐø·³¡£×î½üÓÐÅóÓÑÎÊÆð×Ô¶¯´úÂëÉú³É¹¤¾ßµÄÔÀí£¬ÄǽñÌì¾Í˵˵ÎÒµÄ˼·°É¡£ÎÒÖ»»áMS SQL SERVER£¬ËùÒÔ¾ÍÖ»ÄÃËü˵ʶùÁË¡£
Æäʵ´óµÄ˼·ºÜ¼òµ¥£¬»ñÈ¡Êý¾Ý¿âÖеıȽÏÔ×ӵĶÔÏ󣬱ÈÈç×ֶΡ¢²ÎÊýµÈ£¬²¢ÕÒ³öÊý¾Ý¿â¸÷×Ö¶ÎÀàÐÍÓëC#Öи÷ÖÖÀàÐÍÖ®¼äµÄ¶ÔÓ¦¹Øϵ¼´¿É¡£µ«¾ßÌ嵽ϸ½Ú£¬ÖîÈçÊDz»ÊÇÐèÒªÒýºÅ£¬ÊDz»ÊÇÐèÒªÌṩ³¤¶È£¬Ä¬ÈÏÖµµÄÈ·¶¨£¬²ÎÊýµÄ·½ÏòµÈµÈ»¹ÊÇÐèÒª±È½Ï·ÑЩÐÄ˼µÄ¡£
¾Ù¸ö¼òµ¥Àý×Ó°É£¬ÎÒÃÇÒª´Ó±íÖÐÉú³ÉÒ»¸öʵÌåÀ࣬ÿ¸ö±í×Ö¶ÎÒ²ÊÇʵÌå¶ÔÏóµÄ×ֶΡ£ºÜÏÔÈ»£¬Ö»ÒªÖªµÀ±í½á¹¹¾Í¿ÉÒÔ¾«È·µÄ²úÉúÕâ¸öÀඨÒå¡£ËùÒÔÏÖÔÚÎÊÌâÔÝʱ¾Íת»»µ½ÁË“ÖªµÀ±íÃû£¬ÈçºÎ»ñÈ¡Ëü°üº¬µÄ×Ö¶ÎÃûºÍÀàÐÍ”¡£
×î¼òµ¥µÄ·½·¨£¬sp_columns '±íÃû»òÊÓͼÃû' ¼´¿É¡£²»ÄÑ·¢ÏÖ£¬TYPE_NAMEºÍCOLUMN_NAMEÊÇÎÒÃÇÏëÒªµÄ¡£
µ±È»ÕâÑù²é³öÀ´µÄ»¹¶¼Ö»ÊÇsqlµÄÀàÐÍ£¬ÐèÒª×Ô¼ºÐ´¸öº¯Êý×öÏÂת»»£¬×ª»»³ÉC#µÄÀàÐÍ¡£±ÈÈ磬½«"varchar"תΪ"string"¡£
select * from sys.types order by name¿ÉÒÔ»ñÈ¡È«²¿SQLµÄÀàÐÍ¡£
×Ô¶¯Éú³É²ÎÊý»¯µÄSELECT£¬INSERT£¬UPDATEµÈÓï¾äÒ²¿ÉÒÔÓÃÀàËƵķ½·¨»ñÈ¡×Ö¶ÎÃû£¬È»ºó²ÎÊý¾ÍÔÚ×Ö¶ÎÃûÇ°¼Ó@·ûºÅ£¬Í¬ÑùÒ²¿ÉÒÔÒÀ´ÎÆ´×°Parameters.AddWith("@×Ö¶ÎÃû",....)Óï¾ä¡£Ï²»¶¼ÌÐøÓÃSqlHelperµÄͬѧҲ¿ÉÒÔÉú³É²ÎÊýÁÐ±í¡£µ±È»Êµ¼Ê²Ù×÷Öл¹Òª¿¼ÂÇ×Ö¶ÎÃûµÄ¿Õ¸ñ¡¢±£Áô×ÖµÈÒòËØ¡£±ÈÈç¿ÉÒÔÔ¼¶¨SQL×ֶεĿոñת»»µ½C#±äÁ¿µÄʱºò¾ÍÓÃÏ»®Ïß´úÌ棬×ֶζ¼Ó÷½À¨ºÅÒýÆðÀ´¡£
´æ´¢¹ý³ÌÉÔ¸´Ôӵ㡣Ê×Ïȵ±È»¸ù¾Ý´æ´¢¹ý³ÌÃû»ñÈ¡²ÎÊýÁË¡£
select parameter_name,DATA_TYPE,PARAMETER_MODE,CHAR_LENGTH = isnull(CHARACTER_MAXIMUM_LENGTH,0)
from INFORMATION_SCHEMA.PARAMETERS
where specific_name='´æ´¢¹ý³ÌÃû' and Parameter_name <> ''
ÎÒÃÇÐèÒªÁíÍâÒ»Ì×ת»»»úÖÆ£¬´ÓSQLÀàÐÍת»»µ½SqlDbType.XXX¡£±ÈÈ磬SQLÀàÐÍÊÇchar(20)£¬ÄÇô¶ÔÓ¦µÄC#ÓпÉÄܾÍÊÇcmd.Parameters.Add("@²ÎÊýÃû",SqlDbType.Char,20);¡£Èç¹ûSQLÀàÐÍÊÇintÐ͵ģ¬ÄǾͿÉÒÔ²»ÐèÒª¿¼Âdz¤¶ÈÁË¡£ÁíÍâ¾ÍÊǸòÎÊýµÄ·½Ïò£¬²¢ÇÒÌåÏÖÔÚParameterDirectionÉÏ¡£
ÖÁÓÚ»ñÈ¡È«²¿Êý¾Ý¿â³£ÓöÔÏ󣬱ÈÈç±í¡¢ÊÓͼ¡¢´æ´¢¹ý³Ì¡¢±êÁ¿º¯Êý¡¢±íÖµº¯ÊýµÈ£¬¿ÉÒÔÓÃselect * from sys.objects where type = 'U' and is_ms_shipped = 0 order by [name]Óï¾ä¡£×¢ÒâÕâÀïµÄ type£¬µÈÓÚUÊÇ±í£¬µÈÓÚV¾ÍÊÇÊÓͼ£¬µÈÓÚPÊÇ´æ´¢¹ý³Ì£¬µÈÓÚFNÊÇ
Ïà¹ØÎĵµ£º
1.¾²Ì¬³ÉÔ±ºÍ·Ç¾²Ì¬³ÉÔ±µÄÇø±ð£¿
2.const ºÍ static readonly Çø±ð£¿
3.extern ÊÇʲôÒâ˼£¿
4.abstract ÊÇʲôÒâ˼£¿
5.internal ÐÞÊηûÆðʲô×÷Óã¿
6.sealed ÐÞÊηûÊǸÉʲôµÄ£¿
7.override ºÍ overload µÄÇø±ð£¿
8.ʲôÊÇË÷ÒýָʾÆ÷£¿
9.new ÐÞÊηûÊÇÆðʲô×÷Óã¿
10.this ¹Ø¼ü×ֵĺ¬Ò壿
11.¿ÉÒÔʹÓóéÏóº¯Ê ......
C#ÀࣺÀàÊÇC# Öй¦ÄÜ×îΪǿ´óµÄÊý¾ÝÀàÐÍ£¬ÀàÒ²¶¨ÒåÁËÊý¾ÝÀàÐ͵ÄÊý¾ÝºÍÐÐΪ¡£È»ºó£¬³ÌÐòÔ±¿ÉÒÔ´´½¨×÷Ϊ´ËÀàµÄʵÀýµÄ¶ÔÏó¡£
C#½á¹¹Ì壺½á¹¹ÌåÊÇÇáÁ¿Ð͵ÄÀ࣬ʹÓÿªÏúÏà¶ÔÓÚÀà½ÏС¡£
C#ÀàºÍC#½á¹¹ÌåÁ½ÕߵĹØϵ£º
1.Êý¾ÝÀàÐÍ£ºÀàºÍ½á¹¹Ì嶼ÊÇÊý¾ÝÀàÐÍ£¬ÀàÊÇÒýÓÃÀàÐÍ£¬½á¹¹ÌåÊÇÖµÀàÐÍ¡£
2.¼Ì³ÐÐÔ£ºÀà¿ÉÒԼ̳кͱ»¼Ì³Ð£¬¶ø½á¹ ......
Eval("")ºÍBind("")¡¡ÕâÁ½ÖÖÒ»¸öµ¥Ïò°ó¶¨£¬Ò»¸öË«Ïò°ó¶¨£¬bindÊÇË«Ïò°ó¶¨,µ«ÐèÊý¾ÝÔ´Ö§³Ö
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½·¨ÓëDataBinder.EvalÒ»Ñù¿ÉÒÔ½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ¸ñʽ»¯×Ö·û´®²Î ......
ÊìϤruby on railsµÄ¿ª·¢Ô±¶¼ÖªµÀ£¬ÔÚrubyÖУ¬ÓÐÒ»¸öºÜÖØÒªµÄÌØÐÔ£¬¾ÍÊÇÄܹ»ÊµÏÖÔª±à³Ì£¬ÌرðÊÇÔÚÓÃÓÚ¿ª·¢WebÓ¦ÓõÄrails¿ò¼ÜÖУ¬ÓõÄÌرð¶à¡£ÔÚrailsÖУ¬Òª´´½¨Ò»¸ö¶¯Ì¬·½·¨²¢ÓëÊý¾Ý¿â±í×Ö¶ÎÏà¹ØÁª£¬Ö÷ÒªµÄµÄ²½Öè´ó¸ÅÓÐÕâЩ£º
1¡¢Ê×ÏÈÅäÖúÃÊý¾Ý¿âµÄÁ¬½Ó¡£
2¡¢´´½¨Ò»¸öActiveRecordÄ£ÐÍ£¬Õâ¸öÄ£ÐÍÓëÊý¾Ý¿âµÄ±íÃû³ÆÓÐÒ»¶¨ ......