vb.net

Passing value from child to mdi parent in VB.net

I have a simple contact book. The application has a main window that's an mdi form. When a contact is added using the "add a contact" form, I want to show a simple feedback message in the parent window status bar saying that the contact was added successfully. Here's the child loading: Private Sub addButton_Click(ByVal sender As System...

What Class for Serializable Multidimensional Arrays?

EDIT: See Below I have a web service which uses a class of functions in order to return data used in various business processes (via InfoPath). One of the functions takes a given SQLCommand object and executes it into a SQLDataReader. Now depending on the SQL command text used this may return one or many rows of one or many columns....

Unit testing framework timeouts in Visual Studio 2008

I'm running some unit tests for a large VB.Net application I help maintain and am running into problems with tests timing out. The test run is set up so that there's no timeout limit on the overall test run, but a limit of 2 minutes per individual test. However, a couple of the tests take a lot longer than this to run, so we tried addi...

*Subtle* Differences between VB functions and Convert.To* functions?

While converting types, I have found myself using both VB functions and BCL Convert.To* methods. E.g.) Cstr() vs. Convert.ToString() CInt() vs. Convert.ToInt32() CDbl() vs. Convert.ToInt64() etc... Are there any subtle differences that should be noted? ...

Force reload of a referenced .Net component in VS2005

We have a VB project that loads a reference to a .Net dll (which we also make). Both projects are being simultaneously developed. When we add new classes to the referenced dll, the main project normally fails to notice the changes. That is, if we added a new class Bar to the Foo dll, we should be able to type "Foo." and have Bar listed...

Can you set VS2008 to break on an error inside a try-catch statement

One of the things I loved about VB6 is that you had the ability to tell the development environment to break on all errors regardless of what error handling you had set up. Is it possible to do the same thing in VS2008 so that the debugger will stop on any error even if it happens inside a try-catch statement? The problem is particular...

Migrate VB6 Data Report to Crystal Report within VS.NET

I am trying to convert a VB6 Data Report (.dsr file) to a Crystal Report through the migration process within Visual Studio. I have read articles that reference adding a Data Report to a Project from Visual Studio 2005/2008 and that it will convert the Data Report to a Crystal Report, but I have not been successful in doing so. Does the ...

Visual Studio vs. #Develop - Default event handlers

Visual Studio and SharpDevelop do not both set up delegates to handle events in the same way. The way they are set up is a little bit different. This makes it difficult to use VS in one place and #Develop in another (on the same project). For Example, in VB, Visual Studio does the following: Private Sub OK_Button_Click(ByVal sender A...

When is it OK to use the GoTo statement in VB.Net?

I have process that needs to create a bunch of records in the database and roll everything back if anything goes wrong. What I want to do is this: Public Structure Result Public Success as Boolean Public Message as String End Structure Private _Repository as IEntityRepository Public Function SaveOrganization( _ ByVal orga...

VB.NET forms behave strange on design-time

I'm developing with VB.NET 2008. One of my host was crashed, so I take the files and keep development on another host. But now something strange is happening:All frames, lines and shapes are disappeared on design-time, but are seen normally in runtime. Please see the attached screenshot (Upper is design-time, lower is runtime). http://go...

TreeView-Like list of Links

I have a have a table with Region_Name, Region_ID fields, and another one with Area_Name, Region_ID fields (each region have Areas that belongs to it). I want to display on my asp.net page a list of links (something that looks like a treeView) so when someone clicks on for ex The Bronx from Region New York in this list: New York The ...

Best data type to store list of strings?

In .NET which data type do you use to store list of strings ? Currently I'm using List(Of String) because it's easier than Array to manage and add/remove stuff. I'm trying to understand what are the other options, when they become handy and when I should avoid List(Of String) usage. Do you use another type? Why and When? ...

Storing and retrieving session variables in Reporting Services 2008

Is there a way to set session variables during login that are then available to reports? We have a reporting services server where we move and denormalize data from our transaction system for reporting purposes. In order to allow our users to login with the same user name and password from the transactional system we have set up custom ...

Converting VB6 PropertyBag in .NET

For certain file operations we use VB6's PropertyBag object to convert various items to a bytearray via the Content property. We then save the bytearray as part of a binary file. Later when we load the file we read back the file, read in the bytearray and reconstitute the item by using the propertybag's readproperty. We use this a lot to...

Converting UTF-8 to ASCII in VB.NET

I am writing a console application, which reads emails from different email boxes and processes through them. Emails are received from various automated systems. The email messages are logged and/or sent forward. The problem is that some emails are encoded in UTF-8 and transfer-encoded in quoted-printable which messes up special charact...

How do I exclude a property from being cached?

I’m caching an object but noticed that one of the properties is being combined with the parent object when it is supposed to only get its value if the object requests it after the initial caching procedure has occurred. So my two questions are: Why does the cache provider not just use the property variables (not the property function...

OOP - Where to put the calls to the Data Access Layer?

I am implementing a Data Access Layer (DAL), which is basically a set of classes with (VB.NET) Shared functions to actually execute the database (CRUD) calls. I am trying to figure out the best place to place the calls to the DAL within the class hierarchy. Let me give an example. Suppose I have a class Customer, with only standard ID, ...

Help with a function I found in a VB.NET 2.0 app I am maintaining

I was going through some reports that were supposed to be displaying 2/1/2009 - 2/28/2009, but instead was displaying 2/1/2009 - 3/1/2009. I have narrowed the bug down to this code, any suggestions? Function GetMonthLastDate(ByVal sDateTime As DateTime) Try Dim strArrMonth() As String = {"", "31", "29", "31", "30", "31", "30...

How to convert this code to LINQ?

I'm trying to write this as LINQ, Original code: For Each CurrentForm As Form In MyForms AddLink(CurrentForm.GetLink()) Next I'm a LINQ beginner, so far I'm not quite sure where to use and where not to. If in this case LINQ will do more harm then help, feel free to flame me. Edit : You can assume that there is an overload for A...

Returning Stringbuilder contents

Trivial I know, but just interested I've got a stringbuilder variable, that I want to return the contents of, but if it's empty I want to return "|", so is it best to use stringbuilder.tostring in the compare statement e.g If lReturnStringBuilder.ToString = String.Empty Then lReturnStringBuilder.Append("|") ...