// refresh the grid // links: // docLink: http://sql2x.org/documentationLink/a90065e7-8ace-4de7-9367-d4653a7c637f public void RefreshCrudeFinancialPaymentCard() { var financialPaymentCard = new CrudeFinancialPaymentCardServiceClient(); try { var bindingSource = new BindingSource(); bindingSource.DataSource = financialPaymentCard.FetchWithFilter( Guid.Empty , financialCardTypeRefCombo.Text , textBoxNameOnCard.Text , textBoxCardNumber.Text , maskedTextBoxCardVerificationValue.Text == String.Empty ? 0 : Convert.ToInt32(maskedTextBoxCardVerificationValue.Text) , textBoxAddressVerificationCode.Text , maskedTextBoxIssuedYear.Text == String.Empty ? 0 : Convert.ToInt32(maskedTextBoxIssuedYear.Text) , maskedTextBoxIssuedMonth.Text == String.Empty ? 0 : Convert.ToInt32(maskedTextBoxIssuedMonth.Text) , maskedTextBoxExpiryYear.Text == String.Empty ? 0 : Convert.ToInt32(maskedTextBoxExpiryYear.Text) , maskedTextBoxExpiryMonth.Text == String.Empty ? 0 : Convert.ToInt32(maskedTextBoxExpiryMonth.Text) , maskedTextBoxAmount.Text == String.Empty ? 0 : Convert.ToDecimal(maskedTextBoxAmount.Text) , financialCurrencyPicker.SelectedValue , Guid.Empty , DateTime.MinValue ); dataGridViewCrudeFinancialPaymentCard.AutoGenerateColumns = false; dataGridViewCrudeFinancialPaymentCard.DataSource = bindingSource; dataGridViewCrudeFinancialPaymentCard.AutoResizeColumns(); dataGridViewCrudeFinancialPaymentCard.Refresh(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } finally { financialPaymentCard.Close(); } }