dates in vb.net...
-
Hi if i select month and year based on that..., i need that month all dates in my datagrid..., Plz help me...,
Magi
-
Hi if i select month and year based on that..., i need that month all dates in my datagrid..., Plz help me...,
Magi
if you want dates of a month in a column just for first date of month as dim date as new date(yyyy,mm,dd) i.e. dim ldtFirst as new date(2007,04,01) - for april and loop through the ldtFirst.DaysInMonth - gives total number of days in the current month, add the rows in the datagrid Milan:rose:
-
if you want dates of a month in a column just for first date of month as dim date as new date(yyyy,mm,dd) i.e. dim ldtFirst as new date(2007,04,01) - for april and loop through the ldtFirst.DaysInMonth - gives total number of days in the current month, add the rows in the datagrid Milan:rose:
plz tell me in loop what condition we want to give..., I am new in this.., Plz send some sample code..., then it will be usefull for me....,
Magi
-
plz tell me in loop what condition we want to give..., I am new in this.., Plz send some sample code..., then it will be usefull for me....,
Magi
in this way........... Private Sub LoadDates() Dim dt As New DataTable Dim dr As DataRow Dim lIntIndex As Integer Dim lIntDysInMonth As Integer Dim curDate As New Date(2007, 4, 1) lIntDysInMonth = Date.DaysInMonth(2007, 4) dt.Columns.Add("dates") For lIntIndex = 1 To lIntDysInMonth dr = dt.NewRow dr.Item(0) = curDate.ToShortDateString curDate = curDate.AddDays(1) dt.Rows.Add(dr) Next DataGrid1.DataSource = dt End Sub Milan :)
-
in this way........... Private Sub LoadDates() Dim dt As New DataTable Dim dr As DataRow Dim lIntIndex As Integer Dim lIntDysInMonth As Integer Dim curDate As New Date(2007, 4, 1) lIntDysInMonth = Date.DaysInMonth(2007, 4) dt.Columns.Add("dates") For lIntIndex = 1 To lIntDysInMonth dr = dt.NewRow dr.Item(0) = curDate.ToShortDateString curDate = curDate.AddDays(1) dt.Rows.Add(dr) Next DataGrid1.DataSource = dt End Sub Milan :)
thank u friend.....,
Magi