DAtaTAble and DataRow
-
I have a monthcalendar control and a combo box control. The current flow of my program is after deselecting a date, it will add a new row in a temporary DataTable. These are the line of codes i am using: Trow= Ttable.NewRow(); Trow[0] = this.monthCalendar1.text; Trow[1] = this.ddlType.SelectedIndex; Ttable.Rows.AddTrow but what if the selected date already exist? what should be done so that it will not add a new row instead update that row? thanks a lot in advance!
-
I have a monthcalendar control and a combo box control. The current flow of my program is after deselecting a date, it will add a new row in a temporary DataTable. These are the line of codes i am using: Trow= Ttable.NewRow(); Trow[0] = this.monthCalendar1.text; Trow[1] = this.ddlType.SelectedIndex; Ttable.Rows.AddTrow but what if the selected date already exist? what should be done so that it will not add a new row instead update that row? thanks a lot in advance!
Hello Maybe you should try using the SELECT command to see if it will give you an existing row or not. If the row exists => update it else => Add a new one Regards:rose: