首页 > 代码库 > C# OracleParameter 执行增删改查 实例
C# OracleParameter 执行增删改查 实例
public static Boolean getLmt(string lmtd_name) { string usr_user = HttpContext.Current.Session["MJERP10username"].ToString(); if (lmtd_name == "") { return true; } //string sql = @"select id from sys_lmtd where lmtd_mde||‘_‘||lmtd_name=‘" + lmtd_name + "‘ and lmtd_username=‘" + usr_user + "‘ union all select ro.id from role_mstr ro join usr_mstr on usr_role_id = ro.id where usr_user = ‘" + usr_user + "‘"; string sql1 = @"select id from sys_lmtd where lmtd_mde||‘_‘||lmtd_name=:lmtd_name and lmtd_username=:lmtd_username union all select ro.id from role_mstr ro join usr_mstr on usr_role_id = ro.id where usr_user =:usr_user"; OracleParameter[] param = new OracleParameter[]{ new OracleParameter(":lmtd_name",OracleType.VarChar,50), new OracleParameter(":lmtd_username",OracleType.VarChar,50), new OracleParameter(":usr_user",OracleType.VarChar,30) }; param[0].Value = http://www.mamicode.com/lmtd_name;"connString"])) { connection.Open(); OracleCommand cmd = new OracleCommand(sql1,connection); for (int i = 0; i < param.Length; i++) { cmd.Parameters.Add(param[i]); } OracleDataAdapter myda = new OracleDataAdapter(cmd); myda.Fill(ds); connection.Close(); } if (ds.Tables[0].Rows.Count > 0) { ds.Dispose(); return true; } else { ds.Dispose(); return false; } }
C# OracleParameter 执行增删改查 实例
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。