Beispiel #1
0
        //public void ddlgodownbind()
        //{
        //    List<tbl_godown> gd = context.tbl_godown.Where(x => x.status == true && x.company_id == companyId).ToList();

        //    ddlGodownName.DataTextField = "godown_name";
        //    ddlGodownName.DataValueField = "godown_id";
        //    ddlGodownName.DataSource = gd;
        //    ddlGodownName.DataBind();
        //    ddlGodownName.Items.Insert(0, new ListItem("--Select Godown--", "0"));
        //}
        public void loadDataTable()
        {
            //SqlCommand cmd = new SqlCommand();
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.CommandText = "sp_SelectRack";
            //cmd.Parameters.AddWithValue("@company_id", c_id);
            //cmd.Parameters.AddWithValue("@branch_id", b_id);
            //cmd.Connection = con;
            try
            {
                //con.Open();
                //DataSet ds = new DataSet();
                //SqlDataAdapter da = new SqlDataAdapter(cmd);
                //da.Fill(ds);
                GridView1.DataSource = context.sp_SelectRack(companyId, branchId); //ds.Tables[0];
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
                //Do Logging
            }
            finally
            {
                //con.Close();
                //con.Dispose();
            }
        }
Beispiel #2
0
 private void loadDataTable()
 {
     try
     {
         GridView1.DataSource = context.sp_SelectRack(companyId, branchId);
         GridView1.DataBind();
     }
     catch (Exception ex)
     {
         ErrorLog.saveerror(ex);
         //Do Logging
     }
     finally
     {
         //con.Close();
         //con.Dispose();
     }
 }