vb.net

Optimize Windows Form Load Time

I have a Windows Form that takes quite a bit of time to load initially. However, each subsequent request to load the Form doesn't take as long. Is there a way to optimize a Form's load time? ...

Trouble with selected radiobuttonlist value on postback vb.net

I have a radio button list on a page that is used to configure products. when the page loads the first time the first list of options is displayed. you select one of them then click a "Next Step" button and the page posts back and shows a new radio button list for step 2. Now if i click a "Previous Step" button i can easily get the previ...

"Could not load type" in web service converted to VB.NET

I wrote a simple web service in C# using SharpDevelop (which I just got and I love). The client wanted it in VB, and fortunately there's a Convert To VB.NET feature. It's great. Translated all the code, and it builds. (I've been a "Notepad" guy for a long time, so I may seem a little old-fashioned.) But I get this error when I try t...

Select rows in dataset table based on other dataset table

I have a dataset that has two tables in it. I want to do the following (or something like it) is it possible and is how I have it correct? dsTabData.Tables("FilingTabs").Select("fs_ID not in (select fsp_fsid from ParentTabs)") how do you reference data from other table in the same dataset? ...

How do I locate a Word application window?

I have a VB.net test application that clicks a link that opens the Microsoft Word application window and displays the document. How do I locate the Word application window so that I can grab some text from it? ...

What should I learn next after VB and C#

Hi All, I am currently learning VB and C# and have been for the last two and a bit years but I would really like to broaden my programming skills a little bit. I was just wondering what people would recommend learning? I have looked into ruby a little bit but haven't really dug my teeth into it, I have also looked into F#. I can't r...

Use Float or Decimal for Accounting Application Dollar Amount?

We are rewriting our legacy Accounting System in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the Dollar amounts using Floats. The legacy system language, I programmed in, did not have a Float so I probably would have used a Decimal. What is your...

Shared/Static variable in Global.asax isolated per request?

I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of per server. It's used for simple translation of data, but does spend some time during start-up loading things from the web.config file, etc. The helper class is 100% thread-safe. Think of it as a simple library of utility ...

Setting the namespace of a WinForms UserControl in VB.NET

How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls? Edit due to camainc's answer: I also have a constraint that I have to have all the code in a single project. Edit to finalise question: As I suspected it isn't possible to do what I required so ca...

Performing validation on a databound object after the property has been updated

I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing IDataErrorInfo for the sake of validating a couple of properties. I have created the functions that perform the valid...

Predefined Dialog templates in VB.NET?

In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing. I just need something simple like Save/Cancel, Yes/No, etc. Edit: MessageBox is not quite enough, because I want to add drop-down menus, listbox...

Passing impersonation token on a Managed Thread to an Unmanaged Thread

I have a case where a VB.Net winforms app needs to play WMV files from across the network. The user running the app cannot be given direct access to the network share. Through impersonation, I can see that the files exist (without impersonation, File.Exists returns false for the files on the network share). When I then try to load the fi...

Intellisense in Visual Studio 2005 between C# and VB - can't navigate to definitions

I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the "Object Explorer", and if from C# to VB, it generates a metadata file. Honestly, what is so complicated a...

Giving class unique ID on instantiation: .Net

I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following dim a as New Foo() dim b as New Foo() and a would get a unique id and b would get a unique ID. The ids only have to be unique over run time so i would just like to use an integ...

Backporting a VB.Net 2008 app to target .Net 1.1

I have a small diagnostic VB.Net application ( 2 forms, 20 subs & functions) written using VB.Net 2008 that targets Framework 2.0 and higher, but now I realize I need to support Framework 1.1. I'm looking for the most efficient way to accomplish this given these constraints: . I don't know which parts of the application are 2.0-specif...

VB.NET on Vista, trying to get date (Today) causes security exception

I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. When I try to run the new VB.NET code in Vista it throws a permission exception for the Today() . If I run Visual Studio Express (this is the 2008 Exp...

Handling empty values with ADO.NET and AddWithValue()

I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE MyTable SET MyVal1 = @val1, MyVal2 = @val2 WHERE @id = @id ...it would cycle through t...

What's so bad about VB.NET?

Having spent time on Reddit and (gasp) Digg, I hear a lot of trash-talk on .NET and MS products, and a lot of interesting talk about other languages. As a (second gasp) Project Manager at a small software company utilizing VB/.NET extensively, I'm not sure what's so bad about it. Can someone tell me where it falls short, what would b...

Add a linebreak in an HTML text area

Hello all, How can i add a line break to the text area in a html page? i use VB.net for server side coding. ...

Tool recommendation for converting VB to C#

We have a project with over 500,000 lines of VB.NET that we need to convert to C#. Any recommendations, based on experience, for tools to use? We are using Visual Studio 2008 and we're targeting 3.5 . ...