473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Duplicate dates

I have been trying to fig out how to build up an array with dates. When its
generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create another
array an put the values from array 1 into it one by one. I tested with
StringCollection object. But i'm stuck. I kant fig out how to do it. Are
there someone that have some code that can show me how to remove duplicate
dates from my array?

Best regards
Trond
Nov 16 '05 #1
2 1462

Why not check the array first before inserting a duplicate? If you are
using a hashtable you can use the .Contains() method to see if the item is
already there.


Trond wrote:
I have been trying to fig out how to build up an array with dates. When
its generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create
another array an put the values from array 1 into it one by one. I tested
with StringCollection object. But i'm stuck. I kant fig out how to do it.
Are there someone that have some code that can show me how to remove
duplicate dates from my array?

Best regards
Trond


Nov 16 '05 #2
Thank you. I will try that. Would be fantastic if you added some code to
that comment, in case you have some. It is always easyer to learn by viewing
some code :-)
Best regards
Trond
"Dummy Here" <du*****@keepthespam.com> wrote in message
news:u0****************@TK2MSFTNGP15.phx.gbl...

Why not check the array first before inserting a duplicate? If you are
using a hashtable you can use the .Contains() method to see if the item is
already there.


Trond wrote:
I have been trying to fig out how to build up an array with dates. When
its generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not
an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create
another array an put the values from array 1 into it one by one. I tested
with StringCollection object. But i'm stuck. I kant fig out how to do it.
Are there someone that have some code that can show me how to remove
duplicate dates from my array?

Best regards
Trond


Nov 16 '05 #3

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

Similar topics

3
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
1
by: Rado | last post by:
Hi All, This might quite simple process for some but I am finding it really difficult to do. What is required is not a standard Duplicate query but a variation on it. For example I have...
8
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same...
2
by: zeke | last post by:
Any assistance is much appreciated... I have a table with duplicate record information and I need to remove certain records based on values in four different fields. For example: PK field ...
24
by: clare at snyder.on.ca | last post by:
I have a SQL query I need to design to select name and email addresses for policies that are due and not renewed in a given time period. The problem is, the database keeps the information for every...
5
by: rob | last post by:
Does anyone know of a duplicate file checker project in C#? Couldn't locate anything on CodeProject or SourceForge. Has anyone here considered writing one?
5
by: ShaneO | last post by:
VB.NET 2005: I need to sort an array of Customer details based on transaction dates. If I use a SortedList the obvious problem is that it does not support duplicate keys. Does anyone have a...
9
by: rjshrader | last post by:
I have a table (tblStatus) with three fields (CustomerID, StatusType and StatusDate). I use an unbound form with three text boxes to enter data into the table when a command button (cmdSave) is...
7
by: jmstur2 | last post by:
I have a table with what I consider duplicate records. Data in all columns are duplicate except for the date column, meaning that duplicate data was entered on different dates and those dates were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.