protected virtual IDbDataParameter AddParameter(IDbCommand cmd, string paramName, object value)
        {
            IDbDataParameter parameter;

            switch (paramName)
            {
            case "User_ID":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Name":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Pwd":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Email":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Address":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_PhoneNum":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Im":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_Website":
                parameter = _db.AddParameter(cmd, paramName, DbType.String, value);
                break;

            case "User_isActive":
                parameter = _db.AddParameter(cmd, paramName, DbType.Boolean, value);
                break;

            case "User_CreatedDate":
                parameter = _db.AddParameter(cmd, paramName, DbType.DateTime, value);
                break;

            case "User_ModifiedDate":
                parameter = _db.AddParameter(cmd, paramName, DbType.DateTime, value);
                break;

            default:
                throw new ArgumentException("Unknown parameter name (" + paramName + ").");
            }
            return(parameter);
        }
Exemplo n.º 2
0
        public DataTable vc_Execute_Sql(String sSql)
        {
            IDbCommand cmd = _db.CreateCommand("vc_Execute_Sql", true);

            _db.AddParameter(cmd, "sSql", DbType.String, sSql);
            DataTable table = _db.CreateDataTable(cmd);

            return(table);
        }