|
I have the product of a quantity and price (both doubles) to give total
dim total as double
the total is then displayed in a textbox when a button is clicked.
How would I get this result (total) in a listbox by clicking a button, and other subsequent results into that listbox.
What is "N" in your above response
Thank you
|
|
|
|
|
It works thanks a million.
With the totals displayed in the listbox, how can I find the total of the
numbers displayed to with two decimal places
|
|
|
|
|
"A fatal error has occurred and debugging needs to be terminated...."
Thanks
|
|
|
|
|
That depends on what you're debugging at the time. Is it managed code?? native code?? An ASP.NET app?? Windows Forms app?? Compact Framework app?? Is this debugging code from your workstation that is running on a mobile device??
Without some more detail, about the only thing anyone can do is point you at Google and start searching for the error message.
|
|
|
|
|
|
Could be a wide variety of things and without seeing the code where it happens, I really cannot tell you.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
For the following lines of VB6 code i get error in vb.net. I am trying to convert the following code to VB.NET.. Can anyone help .Thanks in advance.
Dim FileBuf As String * MSG_DATA_LEN
On Error GoTo OpenFailed
Open sFile For Binary As #1
LSet(FileBuf = sMsgData + MSGDATA_END_MARKER)
Put #1, MSG_DATA_FILE_OFFSET, FileBuf
Close #1
bResult = True
Exit Sub
OpenFailed:
bResult = False
End Sub
--------------------
Errors i got:
'Put' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
'Open' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
|
|
|
|
|
Forget this old method for File I/O functionality use the new managed classes under System.IO namespace e.g. by using StreamReader you can easily read a file by using the following code:
Try
Dim Data as String = ""
Dim sr as new System.IO.StreamReader("FileName")
Data = sr.ReadToEnd()
sr.Close()
Msgbox(Data)
Catch Ex as Exception
Msgbox(Ex.ToString())
End Try
AliAmjad(MCP)
|
|
|
|
|
Thanks for your reply,
and what is the equivalence of the following code in vb.net?
Global Const SQL_SUCCESS = 0
thanks
|
|
|
|
|
Hi,
You can use Public Const SQL_SUCCESS = 0 in VB.Net 2005.
You may put this code in a Module to make it Global to your application.
I hope this helps.
-- modified at 9:02 Thursday 1st November, 2007
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
I am writting a car PC project and have got to the last bit now, the DVD player.
I started using WMP, but it has limited functionality, and I was told to try DirectShow which I didn't understand. SO MSWebDVD was my option, as it seems really easy, apart from one problem I have.
How do you tell MSWebDVD what drive you want to use, it only uses one of my drives. I also want to play movies from my hard disk, but using the code:
MSWebDVD.dvdidrectory = "c:\dvd\video_ts"
only works if there is a DVD in the DVD drive, why is this?
Surely you don't have to have a disk in the DVD drive to enable MSWebDVD to play a DVD folder on the hard disk.
Thanks for any sugestions
Craig
|
|
|
|
|
As far as I can tell, it will only work with DVD volumes, not non-DVD drives. That property sets the current video root of a DVD volume, which can have multiple roots in various directories on the disk.
|
|
|
|
|
But why do you have to have a disk in one of the drives, and with 2 DVD drives, which one is the one that it uses?
DirectShow can be used to play DVDs, can anyone post a small code snippet to get me started, as I don't understand all the filter graph stuff that I was reading on the Microsoft site.
Thanks again
|
|
|
|
|
Hi I am converting a project fromVB6 to vb.net the following line gives an error, Can anyone tell me how to fix it?
Private Sub Form_Load()
Load(AccessForm)
Load(LeaveMsgForm)
The error I get is:
'Public Event Load(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
|
|
|
|
|
s3rro wrote: Private Sub Form_Load()
You have to change its structure like this:
Private Sub Form_Load(sender as Object,e as System.EventArgs) handles MyBase.Load
'Additional Code here
End Sub
Hope it helps !
AliAmjad(MCP)
|
|
|
|
|
|
I am in the final throws of my development for an app so I have started my testing.
One of my scenarios is a the removal of the SQL Native Client driver (Windows XP). After the uninstall, I attempt to run the app and am always presented with this error message, which is expected as the native client was required.
The problem I have is that I did not write in a message box to display this error!
I've searched through the code to find a rouge msgbox but found nothing that would present this error.
Any suggestions to suppress this so I can present something more friendly?
Here's how i create connection, if needed
<br />
<br />
Try<br />
Using connection As New OdbcConnection(ConnectionString)<br />
Dim command As New OdbcCommand(queryString, connection)<br />
connection.Open()<br />
<br />
Dim reader As OdbcDataReader = command.ExecuteReader()<br />
<br />
While reader.Read()<br />
count = reader(0).ToString<br />
End While<br />
<br />
connection.Close()<br />
reader.Close()<br />
End Using<br />
Catch ex As Exception<br />
SQLERROR = True<br />
WriteErrorLog(ex.ToString)<br />
Exit Sub<br />
<br />
End Try<br />
|
|
|
|
|
I think this is an unhandled exception error message try to use this code to handle it:
Dim withevents ap as AppDomain
Private Sub ap_UnhandledException(ByVal sender As Object, ByVal e As System.UnhandledExceptionEventArgs) Handles ap.UnhandledException
'Additional Code
End Sub
hope it helps !
AliAmjad(MCP)
|
|
|
|
|
Exactly what it was! Thanks for letting me know, YTMND!
|
|
|
|
|
??? I wasn't letting u know that Its an unhandled exception but rather tried to give you the solution.
AliAmjad(MCP)
|
|
|
|
|
If you're running on SQL Server, why are you bothering with the ODBC provider?? It's slower and doesn't use any features or optimizations that are specific to using SQL Server.
|
|
|
|
|
Its the only way i know how to do it programmatically...
|
|
|
|
|
It's not very different from what you already have. You're just using the OdbcXXX classes instead of the SqlXXXX set of classes.
|
|
|
|
|
After I finished converting(with visual studio 2005 automatic convertor) a windows application written in vb.net 2002 to vb.net 2005
I recieved few syntax errors that I did not find a sulution for them yet.
The first one is:
The error line - If TypeOf Me.WorkingTable.Column(i).DataType is Boolean Then
The error message- Expression of type 'system.Type' can never be of type 'Boolean'.
finally worked like this:
If Me.WorkingTable.Columns(i).DataType is GetType(Boolean) Then
-- modified at 12:25 Wednesday 31st October, 2007
|
|
|
|
|
Hi all...
I am using the following code: Shell("cmd.exe /c cscript C:\Projects\TEST\FileMonitor.vbs", AppWinStyle.Hide, True, -1) in vb.net
Now... the FileMonitor.vbs section is a vbscript file that contains code to monitor a folder for any new file creations... when it gets the file i can have cmd prompt display the filepath\filename. Is it possible to send this filename\filepath back to vb.net as i run the Shell("cmd.exe /c cscript C:\Projects\TEST\FileMonitor.vbs", AppWinStyle.Hide, True, -1) in vb.net??? I want add this filename into a variable.
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|