|
:(Hi,
I would like view the remote system files and select some of them for processing, similar to OpenFileDialog box for local/network files. I downloaded the FTP Client from www.enterprisedt.com, and it works great for uploading and downloading files by providing path. How can I browse the files?
Thanks
|
|
|
|
|
I think an FTP Client already had ability of browsing files on FTP server
so just select file and download it to process
is it ur mean?
<< >>
|
|
|
|
|
I'm looking for a way to countdown between two dates which will yeild "Years" "Months" Weeks" and "Days" to go.
EG(10/22/2005 to 10/26/2005 would yeild "0 Years" "0 Months" "0 Weeks" and 4 Days")
Been playing with datediff, dateadd and can't seem to find a way.
Any help would be appreciated.
Regards
|
|
|
|
|
Check out TimeSpan. It should provide you with the information you need.
|
|
|
|
|
Checked it out. Doesn't seem to do the trick. It will return in days but I need to count down.
IE(10/22/2005 to 11/22/2006 is 1 year 1 month 0 weeks and 0 days)
|
|
|
|
|
You can easily do this with just DateDiff and DateAdd.
Just create a function that first calculates the difference in years using DateDiff. Subtract that value from the original End date using DateAdd. Then calculate the difference left in months from the new temp End Date. Subtract that value from the new temp date to recalculate a new value for the temp end date, which should now only be different by days. Take the days left and split them into weeks and residual days left.
|
|
|
|
|
im_hoser...
The message displayed at the end of the below code displays the correct 2 years, 8 months, 2 weeks and 3 days. The only protection missing is checking, before this code is executed, whether or not the from date is after the to date; but, I'm sure you have that covered already.
This looks like a very useful routine. Think I'll put it into a Double Text library so I have it whenever I need it.
George
Dim Years As Integer
Dim Months As Integer
Dim Weeks As Integer
Dim Days As Integer
'** Create a couple of dates to play with
Dim TempDate As Date ' Working date
Dim FDate As Date = Now ' The first, or from date
Dim LDate As Date = DateAdd(DateInterval.Year, 2, FDate)
LDate = DateAdd(DateInterval.Month, 8, LDate)
LDate = DateAdd(DateInterval.Day, 17, LDate) ' The last, or to date
'** Determine the number of years in the interval
Years = DateDiff(DateInterval.Month, FDate, LDate)
Years = (Years - (Years Mod 12)) / 12
'** Advance the first date up by the number of years
FDate = DateAdd(DateInterval.Year, Years, FDate)
'** Determine the number of whole months
'** Calculate the raw number of months
Months = DateDiff(DateInterval.Month, FDate, LDate)
'** Set up a temporary date that is the first date advanced by
'** the number of raw months
TempDate = DateAdd(DateInterval.Month, Months, FDate)
'** If the raw number of months is too many, back off by 1 month
If DateDiff(DateInterval.Day, TempDate, LDate) < 0 Then
Months -= 1
End If
'** Advance the first date by the number of months
FDate = DateAdd(DateInterval.Month, Months, FDate)
'** Determine the number of weeks and days
Weeks = DateDiff(DateInterval.Day, FDate, LDate)
Days = Weeks Mod 7
Weeks = (Weeks - Days) / 7
MsgBox(Years & ControlChars.CrLf & _
Months & ControlChars.CrLf & _
Weeks & ControlChars.CrLf & _
Days & ControlChars.CrLf)
|
|
|
|
|
im_hoser...
As part of preparing this code for saving in a Double Text library, I reworked it a bit. It's should now be more accurate. If you would prefer the revised code, please download this text file from my web site.
http://www.2goodsoftware.com/snippets/intervalcalc.txt
|
|
|
|
|
Thanks George. Very nice code.
|
|
|
|
|
Does anyone know a good way to install an application on a remote computer. Our company has 4 locations and right now I am having to remote desktop in to each to load updates. I was wondering if there was a installation utility or code for one that allows you to install an app on remote computers from a central location.
Jim
Jim Wilcox
|
|
|
|
|
|
hellow to all..
i am writeing a code that works on database in sqlserver ..
i wrote the following code
Dim sSQL As String
sSQL = "Select * From Cities"
Try
conSQL.Open()
Dim MyDataReader As SqlClient.SqlDataReader
Dim MySqlCommand As SqlClient.SqlCommand
Dim MyDataSet As DataSet = New DataSet
Dim MySqlDataAdapter As SqlClient.SqlDataAdapter
MySqlDataAdapter.SelectCommand = New SqlClient.SqlCommand(sSQL,conSQL)
MySqlDataAdapter.Fill(MyDataSet)
MySqlCommand.Connection = (conSQL)
MySqlCommand.CommandText = sSQL
MyDataReader = MySqlCommand.ExecuteReader
Do While MyDataReader.Read
cmbCity.Items.Add(MyDataReader(0))
Loop
MyDataReader.Close()
conSQL.Close()
conSQL.Dispose()
i get the following error
"Object refrence not set to an instance of an object"
thank's for the help ..
|
|
|
|
|
The problem is with "MySqlCommand".
You need to have it reference an object before using it.
|
|
|
|
|
u mean to make it like this ?
Dim MySqlCommand As SqlClient.SqlCommand = New SqlClient.SqlCommand
|
|
|
|
|
Right. But from the looks of things, your code needs to be cleaned up a bit more.
First of all, you're trying to execute the same SQL command twice. Was this the intent? (I don't think so.)
You're reading it once here...
MySqlDataAdapter.SelectCommand = New SqlClient.SqlCommand(sSQL,conSQL)
MySqlDataAdapter.Fill(MyDataSet)
And the other here...
MySqlCommand.ExecuteReader
I think you should get rid of the Adapter and DataSet and stick to MySqlCommand since I didn't see your code really using them anyways. Also, you need to dispose MySqlCommand and its DataReader once you're done using them. Not doing so would cause a database connection "leak" (for a database like Access, there are only a finite number of connections that can be made so this is important). Dispose them before you dispose the connection.
[edit]
Oops. I just noticed that you are closing the DataReader. You just need to dispose the MySqlCommand then.
[/edit]
-- modified at 15:04 Wednesday 26th October, 2005
|
|
|
|
|
that's great ..
thank u for ur support
|
|
|
|
|
Hi,
I need a hand. What I need to do is to read a word from a file (this I can do). Then I need to get my program to remove all duplicates from the word. After that I need to load that into a string of textboxes and then to add the alphabet starting from the last letter of the word.
e.g
1. Load the word mememe
2. Strip the duplicates so the final word would be me
3. Insert into textboxes and add alphabet e.g mefghijklnopqrstuvwxyzabcd
Thanks in advance
Stevelam
|
|
|
|
|
Steve...
You didn't specify in the specs whether or not the removal of duplicate letters, and the appending of the alphabet was to be case sensitive. The functions I wrote are both case sensitive.
Download this Visual Studio project from my web site.
http://www.2goodsoftware.com/snippets/duplicate letters.zip
When you run the project in VS, type any string into the textbox and click the button (neither control is appropriately named or initialized since the project is just a test bed). The modified string will be displayed in a message box.
There are two functions ... RemoveDupLetters and AddAlphabet. Copy both functions and paste them into a module (for global scope) in your project.
If I can be of further help, please let me know.
George
|
|
|
|
|
Thats great, thanks. The only problem is the fact that if I put in hello it gives me helopqrstuvwxyz but really I could do with helopqrstuvwxyzacbdfgijkmn
Thanks again for the quick responce.
Steve
|
|
|
|
|
I though the idea was to remove duplicate letters ... as in the second L in hello? Mayhe I missed something. Anyway, your welcome.
|
|
|
|
|
Sorrry I should have said that I needed the whole alphabet in the end, just that it started after the last letter and didnt have any duplicates. Hope you can help. Thanks once again.
Steve
-- modified at 14:35 Wednesday 26th October, 2005
|
|
|
|
|
Steve...
The plot thickens. To ensure that I fully understand what the specs are, please reply with the entire string you expect to get when you enter "hello".
|
|
|
|
|
hellow to all ..
i had read the following artical
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnword2k2/html/odc_wdoverride.asp
on how to overide a command in office word and other office programs ..
but there are plenty of things that i didn't understand ...
like , where do i put Subroutines ?
and how the Override.exe file is related to all this ...
i will be thankful if can anybody help ...
thank's
byebye
-- modified at 5:42 Wednesday 26th October, 2005
|
|
|
|
|
hi,
i m using data grid...how it is possible that data grid does not display null if database does not have value for that perticular column.
i need to print datagrid,
its very urgent please help me.
|
|
|
|
|
Me.columnname.NullText = ""
|
|
|
|