- 字串比對
groupName == "ansvalue"
↓↓↓
groupName.Equals("ansvalue", StringComparison.CurrentCultureIgnoreCase)
- SQL指令 join
string strValue = "(@AnalysisVarID,@AnalysisGroupID,@GroupCode{0},@GroupValue{0})";
...
DbCommand cmd = db.GetSqlStringCommand("INSERT INTO AnalysisGroupCode Values" + string.Join(",", lstValue.ToArray()) +";");
- TransactionScope
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
{
...
}
- Trim()
- IDataReader
using (IDataReader reader = db.ExecuteReader(cmd))
{
if(...)
{
admin.ID = (reader.IsDBNull(0) ? 0 : reader.GetInt32(0));
...
}
}
沒有留言:
張貼留言