|
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 )
|
|
|
|
|
hey!
that's not the way to answer man.
i love dot net.... but there are times when we need to deliver something very important even in vb6..
its not a DEAD LANGUAGE
i have even delivered some quality products in VB6...even for BIG BIG BIG corporate houses (with turnover larger than trillions)
anyways, the guy needs to force referential integrity with some sort of logical code.
and it even runs better with access.
vb6 + access is better approach for small and portable applications... far more better
Ashish Sehajpal
|
|
|
|
|
Ashish Sehajpal wrote: its not a DEAD LANGUAGE
Then it's on life support. SOME PLEASE PULL THE DAMN PLUG!!
|
|
|
|
|
If anyone tries to develop in VB6 in my company, they will get a beating of the like of no other. . Even adding new modules to existing software is done with .NET Classes which are made COM visible.
I asked the question, a month or two back why people continue to develop in VB6 and I got many excuses, which I did not think were valid. The only conclusion I could come up with, is that them still developing in VB6 could not be bothered to move out of their comfitable world into the .NET world. So while these "Wright Brothers" mess with their plane, I'll be zooming around in my jet plane
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Steven J Jowett wrote: I asked the question, a month or two back why people continue to develop in VB6 and I got many excuses, which I did not think were valid.
Yeah, I can't really find a good reason comming out of anyone either. If you need to talk to the old code, COM is where you find the interface to do it. What's the FRICKIN' PROBLEM?? The move has to be made now, not later. Doing it later just makes it more expensive because, now, you've got to hurry up and get it done before the VB6 runtime isn't supported on next-gen Windows, thereby giving you a hard-coded deadline.
|
|
|
|
|
Ashish Sehajpal wrote: its not a DEAD LANGUAGE
By dead, I mean that all support was withdrawn for it some time ago, and there will be no new versions or new features again, ever.
But, it was always a crap language. C++ may be a good choice for small, portable applications, VB6 was always a good choice for people who didn't understand C++.
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 )
|
|
|
|
|