public void BindGrid() { DataSet dsExpenseMasterAccount = CExpenseMasterServices.ExpenseMasterTaccountList(); GvAccount.DataSource = dsExpenseMasterAccount; GvAccount.DataBind(); }
protected void binddata() { scon.Open(); SqlCommand cmd = new SqlCommand("Select * from Account", scon); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { GvAccount.DataSource = ds; GvAccount.DataBind(); } else { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GvAccount.DataSource = ds; GvAccount.DataBind(); int columncount = GvAccount.Rows[0].Cells.Count; GvAccount.Rows[0].Cells.Clear(); GvAccount.Rows[0].Cells.Add(new TableCell()); GvAccount.Rows[0].Cells[0].ColumnSpan = columncount; GvAccount.Rows[0].Cells[0].Text = "No Records Found"; } }
private void FillCustomerDeatilGrid() { try { iUserCreationClient userClient = new iUserCreationClient(); CustomProfile profile = CustomProfile.GetProfile(); //GvAccount.DataSource = AccountClient.GetGetCustomerDetail(profile.Personal.UserID,profile.DBConnection._constr);//UserID added by vishal old GvAccount.DataSource = userClient.GWCSearchUserList(CompanyID, DeptId, profile.DBConnection._constr); //Change by Suresh For GCC Admin Invoiceing iCompanySetupClient Cmpny = new iCompanySetupClient(); // GvAccount.DataSource = Cmpny.GetInstituteDetails(profile.DBConnection._constr); if (GvAccount.DataSource != null) { GvAccount.DataBind(); } userClient.Close(); } catch (System.Exception ex) { // Login.Profile.ErrorHandling(ex, this, "AccountSearch.aspx", "FillCustomerDeatilGrid"); } finally { } }
//List<Account> aList; protected void Page_Load(object sender, EventArgs e) { //RefreshGridView(); Account acc = new Account(); GvAccount.DataSource = acc.GetAllAccount(); GvAccount.DataBind(); }