You'll need a recursive function to traverse through all the directories. Actually getting mp3 files in the directory is easy.
This will return a string array of each mp3 file located DIRECTLY under the directory c:\songs. In other words it won't find files in any subdirectories. To do that you would create a method that takes a path as a paramater. The method would get all the .mp3 files under the path and then loop through all the subdirectories. For each directory it finds it will call itself passing in the directory to search. io.Directory.GetDirectories(path) will return all the directories under the given path. I'm sure you can find examples using google to traverse a directory tree.
Hey there, i am looking for a way to be able to filter a ListView with a TextBox where i can insert a few characters, say "CA" and ii will filter the ListView across multiple columns. eg. If i have a ListView with Artist and Title. i want to type in "Hello" and it will display whatever matches that Pattern in the "Artist" column and "Title" column.
How to create aspx pages with top part of the page constant accross multiple pages. Is there anything like frames in vb.net or any other way of implementing this. I have some drop down lists and a button control, on top of multiple pages. Selection of the drop down list values and button click event should trigger a resulting page in the bottom part. Appreciate all the help
I am trying to insert some date columns into a MySQL database using vb.net. MySQL has a date format like YYYY-MM-DD. I am inserting text files and the date columns are formatted like MM/DD/YYYY. Is there any way to format the date using vb.net so I can insert the files?
Did you try to insert data as it is (MM/DD/YYYY)? I've noticed that SQL Server does the same thing. Some time ago I created parser to get customers info from flat file and didn't have to change anything. Try it first if it doesn't work you can use Format function of String class to convert your date.
Make sure your date first converted to String. You can do this by using Date.ToShortDateString().
Here's the code that will help you to convert your date to String. This is just example of todays date to format you need (YYYY-MM-dd). So all you need is to get your dates and change them to this format by using ToSting function I'm giving you.
Dim MyDate As New DateTime<br />
Is this code correct because I keep gettting the error:
Incorrect date value: '02/07/2006' for column 'OrderDate' at row 1
Here is code:
Dim dtTable As New DataTable
Dim row As DataRow
Dim formatdate As New DateTime
For Each row In dtTable.Rows
If row("datereceived").ToString() = formatdate.ToString("MM/DD/YYYY") Then
ElseIf row("backorderdate").ToString() = formatdate.ToString("MM/DD/YYYY") Then
ElseIf row("datecanceled").ToString() = formatdate.ToString("MM/DD/YYYY") Then
ElseIf row("orderdate").ToString() = formatdate.ToString("MM/DD/YYYY") Then
Dim dtTable As New DataTable<br />
Dim row As DataRow<br />
Dim formatdate As New DateTime<br />
For Each row In dtTable.Rows<br />
If row("datereceived").ToString() = formatdate.ToString("MM/DD/YYYY") Then<br />
ElseIf row("backorderdate").ToString() = formatdate.ToString("MM/DD/YYYY") Then<br />
ElseIf row("datecanceled").ToString() = formatdate.ToString("MM/DD/YYYY") Then<br />
ElseIf row("orderdate").ToString() = formatdate.ToString("MM/DD/YYYY") Then<br />
End If<br />
First, the Date/Time in any SQL database doesn't have a format. The format only applies when the data is displayed, not when it's stored.
If you database and code is setup properly, you don't have to worry about the format at all. Using a parameterized query, the parameter objects worry about the conversion for you. All you have to do is pass in a DateTime object into the parameters Value property.
You missed the part where I said you had to provide a DateTime object to the Value property of the Parameter object. You have to convert that String to a DataTime object first. Try the DateTime.Parse()[^] method to get a DateTime object from a String. Don't forget to valid your data before you pass it to the database. You don't want dates from the early 5th century getting in there now do you?
If you database and code is setup properly, you don't have to worry about the format at all.
Are you saying that, he had to format the string representing Date/Time since his database and code is not setup properly? Normally inserting a string into a Date/Time field in any format will work. What are the possibilities that result in a need for additional formatting work? Where has jds gone wrong here?
My company is switching from Lotus Notes to Exchange. Our Notes client have functionality, which allows user to select emails (as many as they want) and place them in a different custom built folders for legal purposes. We would like to duplicate this functionality in Exchange. Since this is a new product I have no idea if it's capble of doing so. I though someone might have some experince with this. Here's what I'm looking for.
1. User selects one or more e-mails.
2. User presses button to bring up a pop up list of xfolders (I guess this is have to be built in VB.NET if possible) that they have access to (preferably based on group membership)
3. User selects which folders they want the mails to be copied to (these will be public folders)
4. A copy of the mail is put in each folder.
Any ideas (links to articles, code, etc.) would be greatly appreciated. Thank you,
You can already do this in Exchange/Outlook and do it without using any code. Each user would have two email accounts open, their own and the account that is public and has all the folders in it. Then they just drag and drop the messages they want to the appropriate folders.
Get into the Exchange Administrators Guide for more information.
We would like to automate this somehow by providing user with list of folders to copy to at once rather than copy to one folder than copy the same email to another folder (you see what I mean).
Some sort of pop up form with list of folders comes to my mind (if possible).
Where user can first select all email he/she would like to copy then select all folders these email have to go to. Any thoughts?
NOw that you explain it that way, you would need code to do that. It's entirely possible to do, but you'd have to write an Office Add-In project to do it. I haven't done any Office work like this so this is about as far as I can go.
But, I'd start with hasing out the interface. From what you've described, the user selects a bunch of documents and does what with them?
The possibilities are for your code to retrieve a list of folders based on userID and add them to the folder list on the left so the messages can be dragged and dropped on them.
Another possibility is to have the user select of bunch of messages, then right-click one of them to bring up a context menu with your folder options on it.
Or the user would select the messages and click on a button in the Toolbar to get a list of available folders to copy the messages to.
Sorry Dave. I didn't explain it in more detail from the beginnind. You know how it is with writing. To me made sense. . Yes. I think last option you've mentioned is the one we want to go with.
(Or the user would select the messages and click on a button in the Toolbar to get a list of available folders to copy the messages to).
We only need to copy (not move) these messages into selected folders (selected by user).
You've mentioned that it would be Office Add-In. Is it possible to write something like this in VB.NET using VS. Currently we have VS v. 2003? And if it is, how do I integrate it into Exchange?
Any reference will do as well.
Thank you, Alex.
Last Visit: 31-Dec-99 19:00 Last Update: 1-Dec-23 20:41