Thursday, September 16, 2010

C # dbparameter few areas need attention



1. Even if the database fields that can have parameters for the air to perform the insert or change, we need to ensure that the non-parameter value for the null, as null when prompted not all aviariables bound, but can be "" (empty string string)

Such as Oracle, there is a table t, t, there is a field varchar2 (10) field c1

Take the value of a text box TextBox1 Insert Field

For example insert into t values (: p1)

OracleParameter op = new OracleParameter ("p1", TextBox1.text); this can not go wrong because the textbox will get an empty string instead of null

But if taking null value as parameter value will be wrong (in fact, the program will reference the variable does not exist error) an error message is not all aviariables bound ~ (many cases of this error, not initialized ah)

As a reference to a class of property is not initialized

銆??OracleParameter op=new OracleParameter("p1",SomeClass.XX)鍏朵腑 XX鏈鍒濆鍖?br />
2. The wrong variable name: sql statement in the declaration of variable argument list is not found in the appropriate bindings

3.not all aviariables bound for this error is because there are redundant variables are not binding. sql statement does not, or spelling errors, and bind the variables in







相关链接:



Using the seven combat the Heart Jakarta Struts



Easy Graphic



South CHINA Sea Hammer Properties Limited



Real Player Iphone 3g



Unlimited access to the latest trick for Gmail account



CEO Online: Yan Huang star CEO Chang on August 15 guest Sina



video format for blackberry



Interview Xoceco Xie SIYU: flat panel TV has been reversed in the Western pattern



Easy Mathematics Education



Infomation File And Disk Management



Convert Avi To 3gp



Call of operations of foreign carriers



MMS can replace SMS?



ps3 OGM



ACCELERATOR with the PP to see potatoes, no buffer Youku



Do for others to do the wedding dress carriers should be out of the "influence" the edge



GOOD ASP And PHP



No comments:

Post a Comment