|
Post some code and maybe someone can help you.
There's nothing left in my right brain and nothing right in my left brain. |
|
|
|
|
|
OK, well for instance, this code throws a NullReferenceException and stops my processing
Dim x
Try
Console.WriteLine(x(0))
Catch ex As Exception
End Try
|
|
|
|
|
Do NOT create empty catch blocks; if you catch an exception, you should act on it, and either report it, or fix the situation, or both.
Which line in the catch block do you want Visual Studio to highlight????????????????????????????????
|
|
|
|
|
I think I am not explaining myself well. What is happening is that VS2008 is stopping execution on the error that is created within the try part of the try-catch block. My understanding (and my prior experience with VS2005) is that the debugger should ignore errors in this part of the block.
ty
|
|
|
|
|
stop being stubborn, add a Console.WriteLine() or some other statement to the catch block, and try again.
|
|
|
|
|
Doesn't matter... same thing.
Dim x
Try
Console.WriteLine(x(0))
Catch ex As Exception
Console.WriteLine("Error")
End Try
|
|
|
|
|
asked and answered here[^].
|
|
|
|
|
cstrader232 wrote: My understanding (and my prior experience with VS2005) is that the debugger should ignore errors in this part of the block.
Your understanding is wrong. When an exception occurs, it is "thrown" upward through the call stack until a catch is encountered or the top of the stack is reached. If you want to have code that runs no matter what you can put it in a Finally block. Or, since this is the VB section, you can use the horrific "On Error Resume Next" construct.
|
|
|
|
|
have you gone to menu tools/options/debugging/general and fooled with those settings?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Yes, I've tried to change them all.
|
|
|
|
|
click on menu debug then click exceptions. i think you can define it there how you want it to behave. see if that's what your looking for.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Hi,
So, specifically what is the debugger setting for the NullReferenceException? Your symptoms suggest that it is currently set to break when the exception is thrown.
Alan.
|
|
|
|
|
I have written a console app in VB.net. Basically it reads some information from a couple Excel files, takes the information contained within and goes to that device on our network to poll for more information. This information is then dumped into a new different Excel file.
I am able to run the application via debug and all works great. I can also run it manually via .exe and all works great.
The problem comes in when i attempt to create a scheduled task (every hour) to run as the System user. My error logging shows that it is not able to access the Excel files (which previously worked when run as admin).
I have tried to troubleshoot by specifically setting the file permissions for that folder/file for the System user.
Could someone shed any light on why I am running into this problem?
Thanks!
-Steve
|
|
|
|
|
a lot of errors like this are caused by account issues - the scheduler usually runs as a particular account - with no standard user environment - so try to fully specify paths etc to the files. Depending on the o/s, you could change the scheduler to use a particular account's credentials - this may throw other scheduled apps out, especially if they require desktop/gui access
The other thing I do is use a 'runas' type program to impersonate the user, including load the registry hive etc, so that the environment is correct - the [in this case 'Excel manipulation program'] is then running under a real user not a limited system account
{ps : I use tqcrunas from a company called 'Quimeras' - Im not affiliated with them in any way, but its a great product that allows me to encrypt/protect credentials/command sets - they are really good at support btw}
'g'
|
|
|
|
|
1. All file paths are absolute.
2. The scheduler for 2008 needs the System account to run scheduled tasks without being logged in as far as I have been able to tell. I have a scheduled task to download a weather map every 10 minutes and would only run using the System account.
3. I attempted to use runas via the command line for the System user however, the password was prompted for, which is not known.
|
|
|
|
|
reply to 3. yep, thats the issue with the standard runas - there are some programs Ive seen that allow you to pass a password to runas
Can you create a seperate user account and test the excel bit under that - if you can use 'runas' and your user account to run the excel bit, then you can use one of the other [encrypted] runas tools I suggest to finish the automation
I still think its your system account vs COM components that EXCEL might be using thats giving you the issue - Ive had the same issue on Windows 2003 server
'g'
|
|
|
|
|
in addition to the tqcrunas product [just to prove Im not biased], Wingnut software also make such a product
http://www.wingnutsoftware.com/[^]
see 'Encrypted runas'
'g'
modified on Sunday, December 27, 2009 9:21 PM
|
|
|
|
|
I have created a query in VB6.0 using MSHFlexGrid. My database is in Microsoft Access 2003. I know how to search the records having a single field (eg:Customer name= "Alex") and get the results displayed in the MSHFlexGrid.
But I need to know how to code a search condition which will display records containing 2 fields (i.e to give 2 parameters to the Condition).eg:How to view the records having Customer name: "Alex" and Sex:"Female". Please, tell me how to do this. I will be deeply grateful for your help!
|
|
|
|
|
|
Hi,
Is it possible to make a from with the thin border like the jumplist one's ?
I searched for it but i found nothing...
Thank you
|
|
|
|
|
You may try to create your own Customcontrol..Or probably the other framework like DevX, Telerik may support this features(I'm not sure)
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Thank you for your answer,Md. Marufuzzaman
A custom form is not the problem, I have already done something similar, but it would be much easier to use the "windows one"...
|
|
|
|
|
You are welcome... Actually it depends on your need..
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hello,
I have experienced a strange problem which I couldn't find a solution.
I have a form and one dataset with one table. Whenever I make an entry into this table, I have used Seed value as 100 and auto increment seed number as 5. Therefore the 1st record is getting 100 as recordNumber.
I have created another form and placed the same dataset and one combobox which is binded to this table. I have used RecordNumber as ValueMember for the combobox. However when the combobox gets populated with the record, its ValueMember returns 105 instead of 100 (even there is one single record). Whatever I tried to find a solution for the problem, I have had no success. What would cause such problem?
Notice: The dataset table gets filled whenever 2nd form gets loaded.
Regards,
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Is it not something to do with the value returned being the next available number for a new record.
For example if you add a second record to the table (which would take 105) does the 2nd form now return 110?
|
|
|
|