vb.net

XPath + Namespace Driving me crazy

Its a .vbproj and looks like this <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <PropertyGroup> <ProjectGuid>15a7ee82-9020-4fda-a7fb-85a61664692d</ProjectGuid> all i want to get is the ProjectGuid but it does not work when a namespace i there... Dim xmlDoc As New XmlDocum...

Multiple themes and masterpages in VB.NET

I was looking at Blogengine.NET today and he has an interesting setup for Themes, figured I wanted to do something similar, however.. I can't make it work at all. For each theme he has a folder like: /themes/Indigo/ /themes/Standard/ /themes/Mobile/ Each theme contains a site.master and they all have their own codebehind that looks ...

Closing Database Connections in .NET

I've got the following bit of code (that another developer wrote) that I need to modify because the ExecuteProc procedure fails. (The reason why it fails isn't in the scope of this question. It's a long story) but in scope is that I'm not sure why a NullReferenceException would occur. It's in VB.NET (I'm not a VB.NET guy myself, so I'm ...

Help Convert C# code to Vb 8.0

. private void Form1_Load(object sender, EventArgs e) { List<CaclulatedData> tests = new List<CaclulatedData> { new CaclulatedData() { Bonds = "First Bond", ...

Is there a simple way to change the text of the 'Open' button on the windows file dialog to 'Select'?

We're using the file picker dialog to allow users to add documents into our application. The word 'Open' doesn't make a lot of sense in this case. Thanks. ...

Is there a Free IDE Plugin for extracting interfaces in vb.net?

Is there a plug-in for the Visual Studio IDE that adds the feature available in C# for extracting interfaces from objects? ...

Are you compelled to eliminate syntactic cruft?

When you encounter working code that is unpleasing to the eye, how likely are you to refactor it? I know code aesthetics is mostly subjective, but I'm bothered a lot by "ugly" code and find it difficult to resist the urge to clean it up. I don't like: Heavy function nesting AndFinally(AndThenDoThis(DoThis(strVar, 1, DoThat("February"...

.NET StreamReader Won't Close

I'm using a RTF file as a template for an ASP.NET web application. My VB.NET code reads the file using a StreamReader, replaces some strings, and creates a new Word document with data from the database. My code closes and disposes of the StreamReader. However, when I attempt to upload a revised RTF file to the web server I get an error, ...

C# and VB.nET type

Does VB.NET have more types than C#? ...

assembly.GetExportedTypes() show different result

Why does assembly.GetExportedTypes() show different result in C# and VB.NET? These two give different results var v = from a in AppDomain.CurrentDomain.GetAssemblies() from b in a.GetExportedTypes() select b; v.Count(); Dim v = From a In AppDomain.CurrentDomain.GetAssemblies(), b In a.GetExportedTypes() Select b v.Count() ...

Calling .Net Class Library (dll) from VB

Hi All, I've used a tutorial (http://support.microsoft.com/kb/317535) to create a VB.NET Class that exports a COM visible method for calculating MD5 checksums. The problem is that I need to call this .dll from a language similar to VB (Extra Basic) and it only supports COM calls. On my machine everything works like a charm, but on the ...

How to get a regular expression to match items with spaces

The following regular expression works if there is no space character, but if the input has a space character, it doesn't work (it seems like a link but JavaScript doesn't work). How can I change it? The regular expression should work for both World and The World. Dim makebkz As String Dim pattern As String = "\(bkz: ([a-z0-9...

limit selections in a listbox in vb.net

Hi all, I am creating a web control in vb.net that contains a list box. I know that I am able to choose a selection mode of Single or Multiple, but I am interested in limiting a Multiple selection to a predetermined size. For example preventing a user from selecting more than 3 items. I have tried adding a Validator to the list box, w...

Webpart Connections asp.net VB

Hi, Im having the following problem with vb.net asp.net webparts. Im trying to create a static connection between webparts but im running into a problem, namely: Could not find the connection provider Web Part with ID 'Ucl_Diary_Summary1' I have the following defined as my iterface: Public Interface IDiaryPartsProvider func...

How do I create a parameterized SQL query? Why Should I?

I've heard that "everyone" is using parameterized SQL queries to protect against SQL injection attacks without having to vailidate every piece of user input. How do you do this? Do you get this automatically when using stored procedures? So my understanding this is non-parameterized: cmdText = String.Format("SELECT foo FROM bar WHERE...

Viewing Time using the Infragistics UltraDateTimeEditor for WinForms

By default the UltraDateTimeEditor displays just the date. What setting do I change to display/set the time in addition to the date? ...

Handle events for dynamic (run-time) controls - VB.NET

I have a WebBrowser control that is created and added to the form during run-time. How do I connect this control to subroutine that can handle its events at run-time? ...

How can I insert an image into a RichTextBox?

Most of the examples I see say to put it on the clipboard and use paste, but that doesn't seem to be very good because it overwrites the clipboard. I did see one method that manually put the image into the RTF using a pinvoke to convert the image to a wmf. Is this the best way? Is there any more straightforward thing I can do? ...

Looking for a DataGridView that allows grouping

Basically I'm looking for a control that allows for grouping in a DataGridView control that can also be editted (I.E. somthing like DataGridView and TreeView into a single control). Thanks in advance. ...

How to rotate a PictureBox on a windows form using vb.net

I need to rotate a picture box 180 degrees when a condition in my if statement is met. Is this possible? ...