Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int CONSULTA_MON_X_NUM_OPC(int NUM_OPC)
- {
- ClsConexion con = new ClsConexion();
- SqlConnection connection = new SqlConnection(con.DB_ConnectionString);
- SqlDataAdapter adapter = new SqlDataAdapter();
- SqlCommand command;
- DataSet ds = new DataSet();
- try
- {
- command = new SqlCommand("SP_CONSULTA_MON_X_NUM_OPC");
- command.CommandType = CommandType.StoredProcedure;
- command.Parameters.Add("@NUM_OPC", SqlDbType.Int).Value = NUM_OPC;
- command.Connection = connection;
- command.CommandTimeout = 0;
- command.Connection.Open();
- adapter = new SqlDataAdapter(command);
- adapter.Fill(ds);
- if (ds.Tables[0].Rows.Count > 0)
- {
- return int.Parse(ds.Tables[0].Rows[0]["par_mon"].ToString());
- }
- }
- catch (SqlException e)
- {
- clss_log.eLog("-----------------------------------------------------------------------------");
- clss_log.eLog("Error: " + DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss"));
- clss_log.eLog("Al intentar ejecutar SP SP_CONSULTA_MON_X_NUM_OPC con el parámetro NUM_OPC: " + NUM_OPC);
- clss_log.eLog("Error: " + e.Errors);
- clss_log.eLog("-----------------------------------------------------------------------------");
- }
- finally
- {
- connection.Close();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement