//------------------------------------------------------------------------------------ //private methods private void GetDataSetToGrid() { try { clientAdmin = new EFlatsServiceReference.WcfEFlatsServiceAdminClient("NetTcpBinding_IWcfEFlatsServiceAdmin"); //load table ds = new DataSet(); ds = clientAdmin.AdminGetTableData(cbType.SelectedItem.ToString().Trim()); BindingSource bSource = new BindingSource(); bSource.DataSource = ds.Tables[0]; dataGridViewUser.DataSource = bSource; SetColumnsReadOnly(); } catch { lblOutput.Text = "Unable to connect to the Database"; } }
//private methods private void GetDataSetToGrid() { try { //refresh connection to client clientAdmin = new EFlatsServiceReference.WcfEFlatsServiceAdminClient("NetTcpBinding_IWcfEFlatsServiceAdmin"); //load table ds = clientAdmin.AdminGetTableData("Flats"); BindingSource bSource = new BindingSource(); bSource.DataSource = ds.Tables[0]; dataGridView.DataSource = bSource; ds.Tables[0].Columns["Id"].ReadOnly = true; } catch { lblOutput.Text = "Unable to connect to the Database"; } }
private void GetDataSetToGrid() { //load table try { ds = new DataSet(); ds = clientAdmin.AdminGetTableData("Applications"); BindingSource bSource = new BindingSource(); bSource.DataSource = ds.Tables[0]; dataGridView.DataSource = bSource; ds.Tables[0].Columns["Id"].ReadOnly = true; ds.Tables[0].Columns["DateOfCreation"].ReadOnly = true; ds.Tables[0].Columns["Score"].ReadOnly = true; ds.Tables[0].Columns["QueueNumber"].ReadOnly = true; } catch { lblOutput.Text = "Unable to connect to the Database"; } }