c# - Does the SQL Server CE engine have to be told the commandtype is text if that should be obvious? -


i've got code:

using (sqlceconnection sqlconn = new sqlceconnection(@"data source=\my documents\\platypusdb.sdf")) {     sqlconn.open();     string dmlstr = "insert platypus_settings (setting_name, setting_value) values(?, ?)";     sqlcecommand cmd = new sqlcecommand(dmlstr, sqlconn);     cmd.commandtype = commandtype.text; //<-- necessary?     cmd.parameters[0].value = settingname;     cmd.parameters[1].value = settingval;     try     {         cmd.executenonquery();     }     catch (exception ex)     {         platypus.exceptionhandler(ex, "writesettingsval");     } } 

...but don't know if commented line needed, bloatcode, or doesn't matter either way?

... don't know if commented line needed

no. not because it's obvious because happens default.

from msdn:

property value
1 of commandtype values. default text.

having said that, not bloat-code , might include it, make code little less ambigious read.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -