Error Handling Works In Design Time But Not In Runtime
Jul 1, 2012I use try catch finally to handle errors in my program. And these work fine when i debug application, but when i install it, error handling does not work?!
View 1 RepliesI use try catch finally to handle errors in my program. And these work fine when i debug application, but when i install it, error handling does not work?!
View 1 RepliesI've created an SQL Query using the query builder. In the query builder, you can test the query by clicking the button "Execute Query", and entering the desired values in the parameter fields.
My query returns the correct results when I do this, but when I seemingly pass the same values at runtime, I get 0 records returned.The query is designed such that you can pass nulls if you don't wish to filter data by that particular parameter.
SQL Query:
SELECT ID, UPC, Quantity, Manufacturer, Style, Color, Size, Category, DateReceived, Cost, OriginalRetail, Retail, LocationID
FROM Inventory
WHERE (UPC = @UPC OR
[code]....
In the query builder "Execute Query" dialog, I enter a value I know that the db contains in the "Size" field, "1/1/1900" & "1/1/2199" in Dates A & B, respectively, and nulls for all other fields. This returns 1 record, which is just as I expected. It works correctly.But when I pass the same values into the method created by the designer, I get 0 records returned. I can't figure out where the problem lies. Even if I enter nulls for all fields other than the dates, it returns 0. This tells me that the dates are causing the problem, but I can't figure out why, because I'm passing strings equivalent to what I entered in the query builder.
using VS2008, targetting framework 3.5I have a rather complex UserConrol which does some of its own rendering.I display this UserControl on a form.Opening that form in the Designer creates an instance of the UserControl in the Designer, which tells me a NullReferenceException is occurring in one of my rendering methods.I have attempted to correct this by making alterations to the UserControl's default constructor, but have not found success.
View 1 RepliesI am looking at implementing a Web Service API for our product. I have figured out how you go about the general architecture/fault handling within WCF. My question is a more general one of how to design the overall error handling system. For example I have a method called SaveCompany (companyobject). Each company name needs to be unique. Say you tried to save a second company called "ABC Inc.". Would you expect to get back a fault named "DuplicateCompanyFault", or would you expect to get back an error code, or something else? I guess the root of my question is would you prefer to receive faults to handle, error code, or some combination? These services are going to be consumed by multiple different entities outside our company on multiple non-.NET platforms.
View 2 RepliesIn some of the forms ,whenever i change some properties using the Properties Window of some controls or the form they get reflected in the Properties Window but will not get changed at Run Time.
I am facing this in quite many of the forms, hence i am applying the property changes in form load, this is causing performance breach .
In a VB.NET winform App I want to place icons on each tab header of a TabControl.I set the ImageList property of the TabControl and for each Tab I set the ImageKey property.My icons show as expected on each tab at design time within the IDE but when I run the App, my icons don't show (an empty space is shown instead).
View 1 RepliesI have a small dataset which has most of its schema defined at design time, but I add a few columns to one of its tables at runtime. My problem is how do I reset those changes? he dataset is not linked to any datasource. It just has its own table which I "manually" populate. The static columns have been added to the datatable at design time. However, I add a few columns as runtime based on a list of categories. Like this:
[Code]....
The dataset is used in a small dialog that pops up within my application. I add the dynamic columns when the dialog is opened by using the Load event. Everything works great the first time. But if you close the dialog and reopen it, there are problems. My startup routine tries adding the dynamic columns again, but an error is thrown saying the column already exists. I have tried a lot of things and did some reading but I can't figure out a way to reset the dataset when the dialog is closed. The only solution is to close the whole application and reopen it. I have tried the following in the Leave event of the dialog form:
[Code]....
I want to ask a question about adding controls in design time (controls may be any win form control or a user control) and adding the control in run time.
View 2 RepliesI'm using .net 2008 Trying to create a small graphic component, I have a problem setting background both at design time and then runtime. I derived a panel like this
[code]...
But it isn't working! If I don't Overrides Property BackColor, this is working as expected but I really need to group in my custom tab.
Is it possible to create a menu at design time and populate it at run time and then display it at the mouse pointer when I click on a cell in a datagrid?
View 11 RepliesI am creating a custom Label control (by simply Inheriting the standard Label control and re-painting the background and text) because I need a very specific background and border. In the constructor of the control, I set the AutoSize property to false so I can have a standard default size for the new label.
Public Sub New()
/*Set the default size of the control to 75x24*/
Me.Height = 24
[code]....
In my application that uses this control, if I create the new custom label at run time (in code), the AutoSize property stays False, and it works properly.If I try to add the new custom label to my form at design time, it comes in with the AutoSize property set to True, and I have to manually set it to False in the properties window. It's not a huge problem, but I don't understand why the behavior is different.
New to reports here. Using VB.NET, my application makes use of datatables it creates from a postgresql database.These datatables are defined at runtime rather than design-time, and I would like some way of generating reports from these datatables at runtime as well.
Should I be trying to create the report template at design-time, and then "binding" a datatable to it at runtime?
i have a treeview which has a bunch of parent and child nodes preset at design time, there is 1 parent node tho which is called developer, that i want to add child nodes to at runtime.When the form first loads im trying to have it check a text file and for each line in the text file add the text/string from that as a child node tot he 'developer' parent node.
vb
Dim reader As String = My.Computer.FileSystem.ReadAllText(Application.StartupPath() & "ConfigDevs.txt")
Dim strs() As String = Split(reader, Environment.NewLine)
For Each s As String In strs
[code]....
Thats what i have so far, how can i set it so 'Dim parentNode As TreeNode = ' points at the 'Developer' node?
I'm trying to make a simple User control that houses one collection of a class that I've made. After building the control All works as planned and then randomly when I try to go to the design time interface for the form I placed the control on I get an error page with the following:
To Prevent Possible data loss before loading the designer, the following errors must be resolved:(ignore and continue: which about half the time works and the control shows up and the other part of the time all of the controls on the page are missing)
The one error is the following:Object of type'System.Collections.Generic.List'1[StaticGraphPlot.clsStaticCurveData]' cannot be converted to type System.Collections.Generic.List'1[StaticGraphPlot.clsStaticCurveData]'.
[Code]...
this is my code:
Dim WB As WebBrowser
WB = GetPage("http://speed.travian.ir/a2b.php?z=" + VillageID.ToString + "&c=" + Type.ToString + "&" + AttackParams)
[code].....
I have written a code to generate numerous command button during runtime depend on the user selection. I would like to find out how do we handle the command button click event?
View 4 RepliesJust started with VS2010. (vb)
Coming from VS2005. (i skipped VS2008)
My question is this. Why do I have to hit save before every build in order to see design changes at runtime? Example: I change the text on a button at design time. I click on run and the text does not reflect the change. But if I saved the form before clicking run, than it does. Also like to add VS2010 runs much slower compared to VS2005 running on the same computer. I understand VS2010 can do more, but a lot of times you don't need it to.
Changing DataGridView BindingSource at Runtime Works but then Fails When Changed
View 1 RepliesConverted an VS 2003 VB Application to Visual Studio 2010. Conversion seemed to work great. Having trouble with the Backcolor of buttons. In design mode they are a light gray (I have them set to transperent and they are on a VBPowerPack.Blend Panel) - but in Runtime they turn the correct color (Steel Blue). How do I get design time to look the same as runtime? Also, they stay light grey in run time if I check Enable XP Styles. Makes me feel better to see the same colors at Design time
View 1 RepliesI have a question regarding the manipulation of a form at runtime. Let's say I created a simple form in the form designer before runtime containing a couple of buttons, text boxes and labels. While the program is running, I would like to change properties of these controls, while having the ability to move them around, along with the addition of newer controls, say a listbox.
After the form is 're-designed', I would like to save the new settings of my form, in either a database or settings file. Whats the best way to implement this?
For some reasons that I don't understand all my design changes won't show up when I hit F5 and run the application. I can put how many new fields and labels with som "hello" text that I wont but they are not displayed at runtime. But all database changes the report i connected to will be displayed.
How can that be? What is wrong with my report when all datachanges runs thru but not my design changes?
I am using VS 2008 and the built in crystal report and viewer.
[Code]...
Im having odd problems with how my form is displaying at runtime...if you look at the 2 attachments you can see at runtime the labels disappear under the check box's, but at design time they are positioned perfectly.
View 5 RepliesI am trying to generate CRC32 in my program. Unfortunately it works ~70% of the time. Would that mean that my function doesn't take care of some special case correctly? Can someone give it a quick look and let me know if I did an error while converting C code to vb.net ?
[Code]...
I created primary/start up Form for my VB2005 app (called Admin.vb). Now when I go back to the solution explorer, I can see Admin.vb but it doesn't have the form icon and clicking it doesn't open the form. Instead it opens the code.All of my other forms are fine and have the right icons and open in the [Design] view ...The form obviously still exists as it opens in runtime but I can't seem to open the design view for it.
View 6 RepliesI have a Visual Basic 2005 program which runs fine if I execute the built Executable. However if I start the application in VS2005 debugger it gives a weird error
[Code]...
So I wrote a VB.net project in Visual studio.I have a scheduled task that is set to run the program every morning at 10AM. If I use windows explorer and double click the application, it runs fine.If I open task scheduler, open the task properties, and browse to the application, then choose run, the program fails, due to Runtime exceptions.I know I have the path entered correctly, since I can debug the instance when it crashes from the task scheduler. VS2010 pulls up my source code.The exception is System.IO.FileNotFoundException, remember, it works fine when I double click the app. If attach a debugger to the process after it is executed from the task scheduler, I can then restart the debugger, and Voila!, The application runs fine.
View 1 RepliesI have an object, say Order where if an error occurs, it raises the ErrorOccurred event. If I'm running some code in say, the codebehind for a .aspx page with an public Order registered as WithEvents and I want to check to see if an error has occurred before I run more code, how do I do this? I can't simply check theOrder.ErrorOccurred. Do I have to create a local boolean flag that switches over in the event handler (OnErrorOccurred)?
Example:
Public WithEvents theOrder As New Order
Public Sub DoStuff()
theOrder.DoSomething()
If theOrder.ErrorOccurred Then
[code]....
I'm a newbie in visual basic dot net. I tried to create a design in run-time. Here's my simple code.
Dim frmLogin As New Form
Dim lblUserName, lblPassword As New Label
Dim txtUserName, txtPassword As New TextBox
[code].....
I work with VB 2008
I need to design my reports by users
please tell my the best way,or the best report type
How do I test for design time? The following code works during RunTime but fails in Design Time?
I assume it is because there isn't a Me.Parent.Name at design time.
Dim strGetColors As String()
strGetColors = fncGetColors(Me.ParentForm.Name)
[code].....