|
What do I have to do so that I just need to do
Right(Text1.Text, 10)
rather than type
Microsoft.VisualBasic.Right(Text1.Text, 10)
|
|
|
|
|
strings.Right(Text1.Text, 10)
|
|
|
|
|
In a default VB.Net application you shouldn't have to do anything.
Microsoft.VisualBasic
is one of the default imports in the project template and
Right(str,len)
works, as is.
If it is not working you can
1) Include an Imports Microsoft.VisualBasic statement at the top of the file
2) Add Microsoft.VisualBasic as one of the imports in the project settings.
Project Properties/Common Properties/Imports
One caveat though, as mentioned, Microsoft.VisualBasic is included by default whenever you create project. If it is no longer there then someone must have explictly removed it and may have a good reason for this.
hth,
Alan.
|
|
|
|
|
I am trying to create a program that copy's one file to another at a certain time each day. Is there ant chance of some help or links to help?
Cheers
|
|
|
|
|
' append into the other file
Dim txt As IO.File
Dim fl As IO.StreamWriter
If txt.Exists("C:\abc.txt") = True Then
fl = txt.AppendText("C:\abc.txt")
fl.Write("testing")
' or open another file and read into it
fl.Close()
End If
' now if you want to copy the file from place to another then use
txt.copy(check parameters)
' for certain time put the timer control on the form to handle the time issue
|
|
|
|
|
I would suggest the following if I understand you correctly.
Function copyFile(ByVal sourceFileName As String)
Dim destFileName As String
If IO.File.Exists(sourcefilename) Then
IO.File.Copy(sourceFileName, destFileName)
End If
End Function
Pass the file name to copy into the function.
Use the OS event scheduler to handle when the program runs. This saves processor resources.
|
|
|
|
|
how could i programmatically upload files to remote server using ftp protocol and also download
files from remote server using ftp protocol.so pls help me to do it with sample code.
tbhattacharjee
|
|
|
|
|
|
i want to develop a win application by vb.net which runs in background.pls give me with a sample code.
tbhattacharjee
|
|
|
|
|
|
please tell me how to write a code in such a way that a function will be called
after every 5 minutes by thread?.pls give help with a sample code for
vb.net.
tbhattacharjee
|
|
|
|
|
put a timer control on your form and then set the interval to 5 mins( remember it takes in put in milli seconds) 5*1000 * 60 = 300000
no in timer event put the code which you need to use like
' code inside timer control
Dim t As New Thread(AddressOf Test)
t.Start()
' put this on top of the form
Imports System.Threading
'put this after timer event
private sub Test()
msgbox "Thread Executed"
end sub
|
|
|
|
|
If you use the System.Timers.Timer component, every time it fires the timer_elapsed event, it executes on a different thread.
Steve
|
|
|
|
|
yes it will run on new thread. so what exactly you need. if the previous thread is already running then what you want with that. if you want to dispose that and re-run the same thread then make the thread global on the form or application depending on the requirement and use t.dispose to close the previous thread.
|
|
|
|
|
Hi, i am new to ado.net so soory, if it seems like a stupid question.
I have filled a datatable with data by a simple query.
i have a datagrid, which doesn't need to show all the columns of the table,
how can i show only some of the columns without needing to query again?
can a dataview show parts of the datatable i have?
thanks,
Nir.
|
|
|
|
|
Hi Nir,
look into the tablestyles and columnstyles properties of the datagrid. you basically create a tablestyle with a mappingname = your datatable.name property and a columnstyle for each column that you wish to display with a mappingname = your datacolumn.columnname property. this can be done at design time through the designer or through code, whichever is easier for you. find docs on tablestyles here, and here's an article describing how to accomplish exactly what you're looking to do.
good luck.
-jim
|
|
|
|
|
Thanks for your help, it worked.
|
|
|
|
|
Hello Nir!
Try out this statement b4 binding the datatable with datagrid..
If dt is the datatable
dt.Columns("ColName").Dispose() <----
_mubashir
|
|
|
|
|
Thanks for your help, i managed to create the table style.
|
|
|
|
|
VS 2003
vb.net
Crystal Report 9
;P;P Now I am facing a big probelem.
I make a project I want to put the project in another system
that is windows 98.But the problem is not working the exe generate a
exception the message (processid =oXfffcblal (-216671),Thread
id = oXfffcc941). I have instaled Frame worke poperly.
In my project I have used Crystal Report com file name
(Crystal Report viewer Control 9) this is main reason. I have checked
in many ways I got a message beginnig the instalation.
unicows.dll is messing. The instalation is failed. Then I got
another message could not register the file .I introduce above my
setup package.How can solve this problem
Anybody help me please.
Continue...
-- modified at 8:12 Friday 26th August, 2005
|
|
|
|
|
did you included the Merge Module of Crystal 9 and put the CD Key in the license file before building the package ????
|
|
|
|
|
can someone help me with the ftp! i want to connect with the ftp through vb.net and download a textfile, edit it in vb.net and upload it back! Do i need to install any dll? Help me please!
|
|
|
|
|
|
I have built one function which creates one text file then work on it and then after processing on the file it deletes the file.
the problem is when I delete the file it gives error that the file is in use.
the code is
Dim txt As IO.File
Dim tmp As System.IO.FileStream
tmp = txt.Create("C:\abc.txt")
tmp.Close()
If txt.Exists("C:\abc.txt") = True Then
fl = txt.AppendText("C:\abc.txt")
fl.Write("testing")
fl.Close()
End If
fl=nothing
txt = Nothing
GC.WaitForPendingFinalizers()
GC.Collect()
'kill("C:\abc.txt")
' or
System.IO.File.Delete("C:\abc.txt")
' THIS DELETE LINE GIVES ERROR
THE ERROR IS
Message "The process cannot access the file "C:\ABC.TXT" because it is being used by another process."
|
|
|
|
|
Rizwan Bashir wrote:
tmp.Close()
You didn't call .Dispose() on the FileStream objects. Do that and you'll be all set.
Forget using the GC class for this. Just remove that code.
Dim txt As IO.File
Dim tmp As System.IO.FileStream
tmp = txt.Create("C:\abc.txt")
tmp.Close()
tmp.Dispose() ' Tells the FileStream object to release the underlying unmanaged file handle
If txt.Exists("C:\abc.txt") = True Then
fl = txt.AppendText("C:\abc.txt")
fl.Write("testing")
fl.Close()
fl.Dispose() ' Same thing...
End If
The next four lines are unneccessary
'fl=nothing
'txt = Nothing
'GC.WaitForPendingFinalizers()
'GC.Collect()
System.IO.File.Delete("C:\abc.txt")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|