473,508 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataRepeater Question

I downloaded the new VB PowerPack 3.0 and began using the DataRepeater. I
have 2 DateTimePickers, current and future. When I add a new item, to the
datarepeater, I want to automatically add 1 year to the future
DateTimePicker.

The DataRepeater contains fields from the Service table of my DataSet.

Here is my code.
Try
Me.DataRepeater1.AddNew()
Me.ServiceDateDateTimePicker.Value = Date.Today
Me.DueDateDateTimePicker.Value.AddYears(1)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try

I don't receive an exception, but the DueDate.... does not change. It
remains the same (today's date) as the ServiceDate....

Tony K.

Jun 27 '08 #1
2 2156
Tony,

DateTime's AddYears method returns a datetime with the added value.

You could then, for example, assign the returned datetime to the
datetimepicker's value property, etc.

Kerry Moorman

"Tony K" wrote:
I downloaded the new VB PowerPack 3.0 and began using the DataRepeater. I
have 2 DateTimePickers, current and future. When I add a new item, to the
datarepeater, I want to automatically add 1 year to the future
DateTimePicker.

The DataRepeater contains fields from the Service table of my DataSet.

Here is my code.
Try
Me.DataRepeater1.AddNew()
Me.ServiceDateDateTimePicker.Value = Date.Today
Me.DueDateDateTimePicker.Value.AddYears(1)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try

I don't receive an exception, but the DueDate.... does not change. It
remains the same (today's date) as the ServiceDate....

Tony K.

Jun 27 '08 #2
Ohhh.. Ok. I'll try that.
Thanks,
Tony K.
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:82**********************************@microsof t.com...
Tony,

DateTime's AddYears method returns a datetime with the added value.

You could then, for example, assign the returned datetime to the
datetimepicker's value property, etc.

Kerry Moorman

"Tony K" wrote:
>I downloaded the new VB PowerPack 3.0 and began using the DataRepeater.
I
have 2 DateTimePickers, current and future. When I add a new item, to
the
datarepeater, I want to automatically add 1 year to the future
DateTimePicker.

The DataRepeater contains fields from the Service table of my DataSet.

Here is my code.
Try
Me.DataRepeater1.AddNew()
Me.ServiceDateDateTimePicker.Value = Date.Today
Me.DueDateDateTimePicker.Value.AddYears(1)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try

I don't receive an exception, but the DueDate.... does not change. It
remains the same (today's date) as the ServiceDate....

Tony K.


Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8927
by: muhamad | last post by:
Hi, How can I use the DataRepeater in CSharp , this control exists in VB6 ,i never used it . I want to insert into the DataRepeater TextBoxs that will show all the time data from the database ....
1
1818
by: craigkenisston | last post by:
Microsoft's datarepeater sample causes warning in the IDE. Hi, The code here : ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpgenref/html/cpconrepeaterwebservercontrol.htm Causes the...
3
3348
by: | last post by:
Hi, NG! Is there any updated version (.Net) of the Datarepeater control or do I have to use the old (VS6.0) version? Thanks. pax
2
2050
by: Neven Klofutar | last post by:
Hi, How can I bind ArrayList of my object to DataRepeater ? I have 2 classes: public class Movie { private String _Name = ""; private Double _Price = 0;
1
1532
by: Chris Leffer | last post by:
Hi. I have a DataRepeater that is filled with the results of a query based on four criteria fields. If one of these criterias is informed, I don't need to display a certain column in my...
3
1874
by: Stephen | last post by:
Hi, Does anyone have a sample of a DataRepeater with Radiobuttons? I am trying to have a datarepeater with radiobuttons but for some reason (suppose there are 10 rows) only the first row has a...
1
1526
by: Stephen | last post by:
Hi, I have a quick question. I am displaying all the orders that are active. I am making use of a datarepeater with checkboxes to display data and a submit button to insert into the database. ...
2
6361
by: Arsalan | last post by:
What is the equivalent of DataRepeater control in VB.NET ?
1
2528
by: =?Utf-8?B?QW1qYWQ=?= | last post by:
Hi i have datarepeater in which i have textboxes, how to create txtCustID_TextChanged event in datarepeater like simple textbox its easy double click it and it create automatically the event but in...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.