コード例 #1
0
        protected void BindModalRvNew()
        {
            Cnx.SelecBD();
            using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex()))
            {
                string VbTxtSql = "EXEC SP_PANTALLA_Reserva 8, @Cs,'','','',0,0,0, @ICC,'01-1-2009','01-01-1900','01-01-1900'";

                sqlConB.Open();
                using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB))
                {
                    SC.Parameters.AddWithValue("@Cs", Session["C77U"].ToString());
                    SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]);

                    using (SqlDataAdapter DAB = new SqlDataAdapter())
                    {
                        DAB.SelectCommand = SC;
                        DAB.Fill(DT);
                        if (DT.Rows.Count > 0)
                        {
                            GrdAlrta.DataSource = DT; GrdAlrta.DataBind();
                        }
                        else
                        {
                            GrdAlrta.DataSource = null; GrdAlrta.DataBind();
                        }
                        ViewState["DT"] = DT;
                    }
                }
            }
        }
コード例 #2
0
        protected void BindModal()
        {
            Cnx.SelecBD();
            using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex()))
            {
                string VbTxtSql = "EXEC Consultas_General_Logistica 11,'','','',1, @ICC,0,'01-01-1','01-01-1'";

                sqlConB.Open();
                using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB))
                {
                    SC.Parameters.AddWithValue("@Cs", Session["C77U"].ToString());
                    SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]);

                    using (SqlDataAdapter DAB = new SqlDataAdapter())
                    {
                        DAB.SelectCommand = SC;
                        DAB.Fill(DT);
                        if (DT.Rows.Count > 0)
                        {
                            GrdAlrta.DataSource = DT; GrdAlrta.DataBind();
                        }
                        else
                        {
                            GrdAlrta.DataSource = null; GrdAlrta.DataBind();
                        }
                        ViewState["DT"] = DT;
                    }
                }
            }
        }