2
Answers

How can i create the Simple Interest with database

amit varma

amit varma

9y
374
1
How can i create the Simple Interest with each record of table?
 when the month is change than the Interest is also update in the table on form_load() or any event....
 
I just want two thing...the SI for each record of table and also update when month is change 
 
 
please see : https://goo.gl/n8ysBT
Answers (2)
0
Nafihudheen KT

Nafihudheen KT

NA 43 66.6k 13y
Thanks for the replay this is very use full tip, but I have to give the ValueMember as "client_id" because I am saving the combobox selected value, means just saving the "client_id" to the database
0
Vulpes

Vulpes

NA 98.3k 1.5m 13y
If you want to use a standard ComboBox rather than the custom one which Pritish appears to be using, then you'll need to create a List<string> where each item in the List combines the two fields you want to use for a particular row. Something like the following if the ID is always of a constant width:

   List<string> list = new List<string>();

   foreach(DataRow row in dt.Rows)
   {
       list.Add(String.Format("{0} {1}", row["client_id"], row["client_name"]);
   }

   comboName.DataSource = list;
   // no need to set DisplayMember and ValueMember properties  

To get the columns to line up properly, you'll also need to use a fixed-width font such as Consolas.
0
Pritish Deshmukh

Pritish Deshmukh

NA 195 90.5k 13y
protected override void OnDropDown(System.EventArgs e){
Form parent = this.FindForm();
if(this.dataTable != null || this.dataRows!= null){
MultiColumnComboPopup popup = new
MultiColumnComboPopup(this.dataTable,
ref this.selectedRow,columnsToDisplay);
popup.AfterRowSelectEvent+=
new AfterRowSelectEventHandler
(MultiColumnComboBox_AfterSelectEvent);
popup.Location = new Point(parent.Left +
this.Left + 4 ,parent.Top +
this.Bottom + this.Height);
popup.Show();

=====

multiColumnComboBox1.Table = dtable;//DataTable
//Column to display after selection
multiColumnComboBox1.DisplayMember = "Band";
multiColumnComboBox1.ColumnsToDisplay = new
string[]{"Band","Song","Album"};//columns to display
//in the dropdown grid