|
Thanks. I definitely give that a try.
|
|
|
|
|
I need load my FORM1 and open my FORM2
While my FORM1 is Working...FORM2 is always On TOP
When My FORM2 finish.....FORM2 is closed.
(Form1 fill a ListBox (100 lines is an example))
Somebody help me?
thanks.
my english is bad.
«« Mexico »»
|
|
|
|
|
Help you with what? You haven't explain what part of this you'r having a problem with. And, I don't see anywhere where threading would come into play.
|
|
|
|
|
With Thread-1 I want fill the ListBox and with Thread-2 open
other WinForm and check when Thread-1 finish the work......
I want that 2 Threads is executing in the same time....
Or give me example for use Threads, multithreading, in same time 
|
|
|
|
|
opening a second form on a second thread is not a good idea. Since you know nothing of threading at all, I'd avoid the topic entirely because there are some hard-to-debug pitfalls with doing this.
All UI forms and controls should be created and accessed from the UI thread (startup thread). Accessing controls and forms from non-UI threads involving using delegates and invoking methods so those objects are accessed only from the UI thread.
You can find numerous examples with a little Googling. Results for "vb.net threading[^]".
|
|
|
|
|
Dim subtotal As Integer<br />
<br />
With Me<br />
<br />
' Me.Definition_dbDataSet.CUSTOMER_ORDER.fillbyreceipt(Me.txtReceiptNo.Text)<br />
' Me.CUSTOMER_ORDERTableAdapter.Update(Me.Definition_dbDataSet)<br />
Try<br />
Try<br />
subtotal = Decimal.Parse(Sell_unitpriceTextBox.Text) * Me.NumericUpDown1.Value<br />
Me.txtOrderNo.Text = Maxorder.ToString<br />
Me.txtReceiptNo.Text = MaxReceipt.ToString<br />
Me.txtTime.Text = .getdate()<br />
Me.txtTotal.Text = subtotal.ToString<br />
ControlSetting(True)<br />
Catch ex As Exception<br />
MessageBox.Show("Please enter Quantity" & ex.Message, "ERROR")<br />
End Try<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Order_No").Value = Me.txtOrderNo.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("TimeDate").Value = Me.txtTime.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Stock_Order").Value = Me.Item_NameComboBox.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Stock_Qty").Value = Me.NumericUpDown1.Text<br />
'Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Amount_Paid").Value = Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells(3).Value * Sell_unitpriceTextBox.Text<br />
strID = txtReceiptNo.Text<br />
strOrder = txtOrderNo.Text<br />
'txtTime.Text = Format(Date.Today, "dd/MM/yyyy")<br />
Me.CUSTOMER_ORDERTableAdapter.InsertSales(strID, strOrder)<br />
' Me.CUSTOMER_ORDERTableAdapter.UpdateSale(strID, strOrder)<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Amount_Paid").Value = Me.txtTotal.Text<br />
Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
Me.CUSTOMER_ORDERTableAdapter.Update(Me.Definition_dbDataSet)<br />
Catch ex As Exception<br />
MessageBox.Show("" & ex.Message, "Error", MessageBoxButtons.RetryCancel)<br />
End Try<br />
End With
i having problem that when i choose new detail from combox to datagridview.it's gv me eror.
And i have another question that how i enter new sales in same receipt_no until i end it.without duplicated data. here my query
INSERT INTO [CUSTOMER ORDER]<br />
(Receipt_No, Order_no)<br />
VALUES (?, ?)
UPDATE [CUSTOMER ORDER]<br />
SET Stock_Order = ?, Stock_Qty = ?, TimeDate_Order = ?, Amount_Paid = ?, Item_ID = ?<br />
WHERE ([Receipt_No] = ?) AND ([Order_no] = ?)
i set my receipt and order_no as primary key...can some 1 help me correct it....thanks thanks thanks in advanced
modified on Tuesday, April 15, 2008 8:34 PM
|
|
|
|
|
First, you don't need to preface everything with Me . Get red of the "With Me" at the beginning of your code also, you don't need it.
Member 4442916 wrote: i having problem that when i choose new detail from combox to datagridview.it's gv me eror.
And that error would be ...??? What lines does it show up on??
|
|
|
|
|
hai friends
i am doing a setup for my project...
while installing ... after 2 or 3 minutes ...
i want the user to enter the key which i will give along with the cd...
the installing should be continued when the key is enterd and correct one
and it should not be stopped by the "TaskManager"
plz help me...
oke bye
thanks in advacne
vijay
|
|
|
|
|
vijaylumar wrote: i am doing a setup for my project...
while installing ... after 2 or 3 minutes ...
i want the user to enter the key which i will give along with the cd...
the installing should be continued when the key is enterd and correct one
The installation should ask for the key straight away, instead of half way through the install. You'll need to use a third party installation tool to do this, like InstallShield or InnoSetup.
IMHO, doing this is a waste of time.
vijaylumar wrote: and it should not be stopped by the "TaskManager"
It's not possible to prevent this...
|
|
|
|
|
Hi
I got an error when trying to delete and move files within the file manager. I can delete or move one file, but when I try to delete or move a second file, I get the error(Error moving file:Portal Root\\CS.CARVEL.mg.08.pdf to Portal Root\\ManWD\\.The process cannot access the file Portal Root\\CS.CARVEL.mg.08.pdf because it is being used by another process). I have to log out and log back in for each file I want to move or delete.
Please help me
Thanks
Cincy
|
|
|
|
|
And this has what to do with VB.NET??
Shouldn't this question be directed at a forum that supports DotNetNuke??
|
|
|
|
|
Hi,
Thanks for the reply.
I searched somewhere to get a solution for this and i found the following
"It is commom problem with the fileupload control in the .Net framework.
In ASP.Net 2.0 the file upload control buffers the file on disk while it is being uploaded.so when we trying to delete the file before completing the buffering ,it will display an error .ie,it will take time if we want to delete an uploaded file ,may be 5 mnts"
can you please advise me for this
Thanks in advance
Cincy
|
|
|
|
|
What's to advise?? You simply have no choice but to wait for the upload to complete before deleting the file. I'm no expert in IIS, but AFAIK, there's no way for you to wipe out a users session, stopping the upload.
|
|
|
|
|
Hi,
I am having a bit of difficulty trying to catch an error thrown by io.ports
I have an app that displays a message on an external screen, using serial comms. The routine to do this needs to be as "bullet-proof" as possible.
Testing the code, it is fine on a standard serial port, I can unplug the port and plug it back in again, and the code recovers, but as an ultimate "real world" test, I tried it on a USB->Serial adapter, and it works well - untill I unplug the USB cable and plug it back in again.
Now, what happens is a bit strange. The application recovers (so the com port is coming back), and starts displaying messages again, but only for a few seconds. I then get the following exception:
System.UnauthorizedAccessException was unhandled
Message="Access to the port is denied."
Source="System"
StackTrace:
at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
at System.IO.Ports.SerialStream.Dispose(Boolean disposing)
at System.IO.Ports.SerialStream.Finalize()
I cannot trap this error, and the application just bombs out. I certainly am not disposing of the serialport object I have created, so this must be being done automatically.
But, my question is, how do I catch, and trap this error? Any help, or pointers would be much appreciated.
Thanks,
Jason
|
|
|
|
|
If you disconnect the cable, the serial port is still a device that shows up in DeviceManager. When you remove the USB device, the entire COM port goes away. The serial device no longer exists. So, when it comes back, your (internally managed) handle to the COM port is no longer valid. It may work briefly, but you've found out what happens.
|
|
|
|
|
Thanks for the reply.
Yes, I had thought this could be the problem, and now, when this type of error occurs, I destroy my serialport object and keep looking through the "My.Computer.Ports.SerialPortNames" collection to see if my comport reappears. If it does, I then create a new serialport object.
However, I get the same problem - a crash after a few seconds.
I suppose the real question I am asking is how to prevent the exception crashing my program completely? All code that accesses the comport is within a try/catch block, but the exception is still unhandled.
|
|
|
|
|
hi jason
Sorry for my poor english,
I understood your problem. But here i am not telling you to do this.
In this situation there is no problem with on board PCI comports. This problem happens only for the USB2Serial cables which are Run through 3rd party drivers(USB2Serial Drivers). When U connected Your USB Device to PC then only u get a comport in your Device Manager. If Your Remove this it will gone pertinently until u connect again.
While Running Your Application If U Remove the USB Device, comport will removed from your PC.
So, In your application before reading/writing to comport, check for comport is present or not. instead of catch the exception.
Thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Thanks for the reply.
I have started checking that the comport is availiable however, if the cable is unplugged between checking for the port and the "open / write / close" cycle, then I cannot catch the error. The cable could be pulled out at any time.
If my display stops working, that is not a problem, the fact my application stops working is VERY bad.
|
|
|
|
|
On 32-bit OS, there is memory of 4GB for each address space. In VB6, 2GB is used for user mode code(for user application running) and 2GB for kernel mode code. Is there any way to increase user mode code memory limit beyond 2GB. Please help.
|
|
|
|
|
VB6 has always been crap. No way I would trust it to manage 20MB of data, let alone 2 gig.
I would ask why you're using such an outdated language and hoping it can be used to handle such a large task ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Hafiz Sikander Rafiq wrote: In VB6, 2GB is used for user mode code(for user application running) and 2GB for kernel mode
Those are not VB6 limitations. Those are set by Windows. The only thing you can do is add the /3GB[^] switch to the Windows BOOT.INI file. Warning! There are consequences to doing so!
|
|
|
|
|
Hi
I want to find out if VFP driver has been added to odbc drivers in control panel\Administrative Tools\Data Sources (ODBC)
and if it has not been I do that by code in my program .
please help me if you know usefull codes .
thanks in advanced .
|
|
|
|
|
We can still see the last time you asked this, why ask it again now ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
hi all,
i have developed an application in vb6 with access as backend. it is running perfectly, but now i am facing a problem.
i have created some table like address, transaction etc.
i have inserted some records in table transaction using some customer id from my address table.
Now problem is this, when i delete a record in this table it allow me to delete even i have set its relation with my transaction table custid.
pl help me
rmshah
Developer
|
|
|
|
|
Well, first of all, why on earth are you using VB6, which is a dead language, and which always sucked ?
You need to write SQL that deletes your records properly, or refuses to delete them at all, if that's what you want. Simple as that, you know the problem, so write code that deals with it, in the manner you are looking for.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|