|
yes if it is a local variable it goes something like this. If not just replace dim with private or public or whatever.
dim dt as DataTable<br />
dt = new DataTable()
|
|
|
|
|
While you have your answer, you shouldn't do this. Always assign a variable a default value the moment you create it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
woul u pls subscribe us sample code of hospital management information system.we'll be very garateful.thanks
with regards
|
|
|
|
|
The depressing thing is that I can't tell if you're joking. If this is homework, you need to do your own homework. If this is paid work, can you tell me the hospital, so I can make sure never to go there ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: If this is paid work, can you tell me the hospital, so I can make sure never to go there ?
Same here, I'll make sure I stay away from there.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
trimp wrote: pls subscribe us sample code of hospital management information system
Nope. Do your own work.
"You posted your question here, indicating that you're so thick you couldn't find the VB Forum if it was licking your bung hole." - John Simmons / outlaw programmer
|
|
|
|
|
Wow. Normally I ignore posts asking people to do whole subsystems for them. An entire hospital management information system? That takes the cake as craziest request so far :P
|
|
|
|
|
Can someone tell me whats wrong with this code: Im getting the following error from vbscript runtime:
Line: 18
Char 1
Error: Object required:"
Code: 800A01A8
This is line 18
* If Lcase(Right(objFile.Name,3))="sln" Then *
-Code-
Option Explicit
'==========================Variable declaration & Initialization================================
Dim objFSO, objFolder, objSubFolder, objSubFile, objFile, objShell, colFiles, colFolders, strFolder
strFolder = "C:\Program Files\Visual Studio 2005 SDK"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strFolder)
Set colFiles = objFolder.Files
Set objShell = CreateObject("WScript.Shell")
'===============================================================================================
For Each objFile in colFiles
Set objFile = objFSO.GetFile(strFolder & "\" & File.Name)
Next
If Lcase(Right(objFile.Name,3))="sln" Then
objShell.Run "devenv /build" & objFile
End If
ScanSubFolders(objFolder)
Sub ScanSubFolders(objFolder)
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
Set colFiles = objSubFolder.Files
For Each objFile in colfiles
If lcase(Right(objFile.Name,3)) = "sln" Then
objShell.Run "devenv /build" & objFile
End If
Next
ScanSubFolders(objSubFolder)
Next
|
|
|
|
|
You seem to be testing the objFile.Name AFTER you have completed the For...Next loop.
The For...Next loop will retreive each file in the folder and when it finds nothing then exits the loop IE it is EMPTY! Try the following
For Each objFile in colFiles<br />
Set objFile = objFSO.GetFile(strFolder & "\" & File.Name)<br />
<br />
If Lcase(Right(objFile.Name,3))="sln" Then<br />
objShell.Run "devenv /build" & objFile<br />
End If<br />
Next
Quote from Great Outdoors:
its a confident traveller who farts in India
|
|
|
|
|
Hello everyone,
I generally look at Google and other websites before I post a question, but trust me I still cannot find and answer to this problem.
I'm using VB.net (2005) . My problem being is that I don't know how to redirect the serial port output to a selected file. I looked in the forum but no luck.
Here is the sequence of events.
User selects a file to write to. No problem here.
Sends a command to the equipment to start outputting text. No problem here.
At the moment the text is going to text box. Is easy to wait for the output to finish and then save the file. But I do not want this. The user does not need to see the text. Just some sort of indication that data is being sent. No Problem here.
Is more like a Serial Port Data Log.
Friend Sub DataReceived(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
Dim newReceivedData As String
Try
' Get data from the COM port.
newReceivedData = selectedPort.ReadExisting
' Save the number of characters received.
receivedDataLength += newReceivedData.Length
RaiseEvent UserInterfaceData("AppendToMonitorTextBox", newReceivedData, Color.Black)
' I guess I could choose to Write the line to the file instead.
Catch ex As Exception
DisplayException(ModuleName, ex)
End Try
End Sub
Any suggestions? Thanks!
|
|
|
|
|
Since you're already adding the text to a TextBox, it's trivial to convert that code to write to a file instead. What's the problem? A TextBox just shows the contents of a String. A file just stores the very same String.
|
|
|
|
|
Dave, Thanks for your reply.
Well, that is what I'm trying to avoid. I do not want the text displayed while data is being output. I can do that already and save it to a file.
Right now I can stop the data from being displayed by removing the appropriate code but can't seem to figure out how to pass it to a file. What I want to do is save each port.readline() to a file file.writeline()
Is like a serial port data log. I hope this clears things a bit. Thanks.
|
|
|
|
|
Wherever you have the code to put the text in the textbox, you replace it with a call to a method that takes one or two parameters, the line to write and maybe the path to the log file. This method would open your log file, write the line, and then close the file. What's so difficult?
|
|
|
|
|
Dave,
You just answered my question. That is what I was looking for. I just didn't know where to put the code and how. Problem solved. Thanks!
|
|
|
|
|
I have to read the last 5 lines of several very very huge ASCII files, several times.
I want to see if it is possible to read only those last lines, instead of reading the whole junk data and getting to those 5 ending lines.
Could someone please help me, how to decrease this amount of waste of cpu time and un-wanted I/O?
|
|
|
|
|
Please don't cross post.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Can anyone help me to expalin how we can set and display only time value in propertygrid control in VB.net
Mahmood
|
|
|
|
|
Your object has to expose a public property that exposes a DateTime object.
If you want a custom editor to change that value, you have to make a custom UiTypeEditor, like this[^].
|
|
|
|
|
Hi All,
How to insert data into MS Project 2003 through VB 6.0 application.
Awating for your early reply.
Thanks.
Ahmed.
Ayaqoob.
|
|
|
|
|
I have a Binding source in a form. And I want to move to a Particular location in the Binding source. But I don't know the Position where to move, rather I know the Field Value of a unique field in the Records. Is there any way so that I can directly jump to that position in the binding source or I have to loop and check for that value in the records ?
Please Advice.
Thanks in Advance.
Sekhar
|
|
|
|
|
SekharOne wrote: Is there any way so that I can directly jump to that position
The binding won't find it for you. You have to know the position of the record, then tell the binding the position to use. So, yes, you have to find it yourself first.
|
|
|
|
|
hello frnd,
i have a XML document i want to read complete XML with DOM.
how can i do it...
cay code sample or link ????
thankx in advance
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Stop cross posting the same question in multiple forums.
You've been told this repeatedly, yet you persist.
|
|
|
|
|
i want to known how we can read one by one pixels from image and compare
|
|
|
|
|
You can't - VB is crap. Your best bet is to use the code in my C# image processing articles. Otherwise you're stuck with get/setpixel, which is very slow.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|