|
|
Is there a better way to run a function every hour than enable a timer with tick value "3600000"? The problem is that when my application is running and this timer is enabled, Windows XP won't shutdown.
|
|
|
|
|
Set the timer for 1 minute. In the Tick event, check the time against the scheduled time. Simple as that.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi!
The error is
"Input past end of file" in the following section
' Load the file.
fnum = FreeFile
Open file_name For Input As fnum
whole_file = Input$(LOF(fnum), #fnum)
Close fnum
Though code is going fine with text files.
Thanks and Regards,
Virendra
|
|
|
|
|
virendra_007 wrote: Though code is going fine with text files.
A CSV file IS a text file. All CSV stands for is Comma Seperated Values.
virendra_007 wrote: whole_file = Input$(LOF(fnum), #fnum)
This is not a good method, as you've found out. Read each line from the file as a text line and process it, one line at a time:
Dim TextLine
Open "MyFile.CSV" For Input As #1
Do While Not EOF(1)
Line Input #1, TextLine
' parse up the line on comma's to get the values
Loop
Close #1
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi! Dave,
Thanx for your kind co.operation.
Regards,
Virendra
|
|
|
|
|
how i will get value Member of the combobox when i am using datatable
jitendra
|
|
|
|
|
How do you mean ? You can set the valuemember property to the name of a column before databinding, is that what you need to know ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
dim con as new oledbconnection("connectionstring")
con.open
dim ds as new dataset
dim ad as new oledbdataadapter("query",con)
ad.fill(ds)
combobox1.displaymember=""
combobox1.valuemember=""
combobox1.datasource=ds.tables(0)
Hope this may help u.
|
|
|
|
|
How do I get javascript such as that listed below to be read in an ASP file before the command <%response.redirect "file.asp"%>
<%response.redirect "file.asp"%>
At the moment it just redirects to file.asp without executing the javascript.
If I remove <%response.redirect "file.asp"%> then the javascript is read, however when I add <%response.redirect "file.asp"%> the javascript is ignored and it just redirects to file.asp. Any ideas why this is happening?
|
|
|
|
|
Why do you have the response.redirect in server tags ? Why not do the redirect in javascript ?
I believe the issue is that the VBScript is executed first, to render the page, on the server. Then, the javascript runs on the client.
This question has nothing to do with VB or VB.NET, it belongs in the web dev forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually the full vbscript code is:
<%id = request("id")
sql = "Select * from listings where id ="&id
open_recordset rs,SQL
hits = rs("hits") + 1
sql ="update listings set hits ="&hits&" where id = "&id
conn.execute(sql)
url = rs("url")
closelink(rs)
closeDB()%>
<%response.redirect iurl(url)%>
Could you advise how, if possible, the redirect statement could be converted to javascript using the same variables?
|
|
|
|
|
Hi:who know use Shared Event Handler?i got problem,i dont this method can use communicated in on computer.one side is server,another side is client.server want to display message in the Listbox,so use this method to get message from client side.can?who know aboout it? can give code?thax
|
|
|
|
|
HI:I dont know the Shared Event Handler can use in one communication two computers.i want to know this method whether can use one side get message frome anther side.thax.
|
|
|
|
|
Hi!
Some one gave me below code in here. I have been trying to convert below code in vb.net
------------------
Dim oldText as string
Dim newText as String
Dim start as Integer, end as Integer
oldText = "I want #this# word bold"
start = Pos("#", oldText) ' Get pos of first #
end = Pos("#", oldtext, start) ' Get pos of first # after start pos.
newText = Strip(oldText, "#") ' Removed # from text
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
PPSLide.Selection.Fond.Bold = true
------------------
but there is no method for this code
end = Pos("#", oldtext, start) ' Get pos of first # after start pos.
so how else could i get the position of first # after start pos
please help
|
|
|
|
|
|
uglyeyes wrote: Pos
IndexOf
uglyeyes wrote: Strip
Replace
I'd recommend that if you're having this much trouble with working out string functions, which appear in intellisense, that you buy a VB.NET book and work through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks guys may be i didnt mention it clearly i dont have any problem getting start and end for the first time. I mean How do i loop through all the strings so that i get all the texts that are in between '#'
|
|
|
|
|
One easy way is to use the split function on the string class. This will return an array of substrings, so you can move through them, known that one denotes the start of a bold section, then next, the end of it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Use substring function.
It acceps 3 arguments("I want #this# word bold",start+1,end-start-1).
Here start will be 7(first #),end will be 12(second #).
So U want characters from 8 to 11.
Regards,
Arun Kumar.A
|
|
|
|
|
I check the intellisense it only supports upto 2 argument in vb.net (1.1) both int and int,int
I am trying to print all the text in bold that are inside # in powerpoint.
Dim oldText As String
Dim newText As String
Dim starts As Integer, ends As Integer
oldText = "I want #this# bold. I want #that# bold.I want #this# bold. I want #that# bold."
'This gets the first
starts = oldText.IndexOf("#")
'get second occurance
ends = oldText.IndexOf("#", starts + 1)
'NEXT STEP
newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
PPSLide.Selection.Fond.Bold = True
PPSlide is a interop power point object.
|
|
|
|
|
uglyeyes wrote: newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
I U use replace, will the start and end remains same?
Regards,
Arun Kumar.A
|
|
|
|
|
Of course not, the string gets smaller by two characters.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, that is what I tried to bring to his notice.
Regards,
Arun Kumar.A
|
|
|
|
|
hope this helps U.
Dim oldText As String
Dim newText As String
Dim starts As Integer, ends As Integer
Dim startsNew As Integer, endsNew As Integer
Dim i As Integer
oldText = "I want #this# bold. I want #that# bold.I want #this# bold. I want #that# bold."
Dim boldCount As Integer,newPosition As Integer,compensateForReplacement As Integer
newPosition=0
compensateForReplacement=0
boldCount=(Number of #es)/2
newText = Replace(oldText, "#", "")
PPSlide.Insert(newText)
For i = 1 To boldcount
starts = oldText.IndexOf("#",newPosition)
ends = oldText.IndexOf("#", starts + 1)
startsNew=starts-compensateForReplacement
endsNew=ends-compensateForReplacement
PPSlide.Select(newText, startsNew, endsNew)
PPSLide.Selection.Fond.Bold = True
newPosition=ends+1
compensateForReplacement=compensateForReplacement-2
Next
Regards,
Arun Kumar.A
|
|
|
|