vb.net

It the use of multiple languages in ASP.NET code behind pages acceptable?

For the purposes of this question, the code base is an ASP.NET website that has multiple pages written in both C# and Visual Basic .NET. The primary language is C# and the Visual Basic .NET webpages where forked into the project as the same functionality is needed. Should the time be taken to actually rewrite these pages, including goi...

How to create Windows firewall exception in Visual Basic 2005?

Is there a way I can create Windows firewall exceptions in VB2005? I'm trying to deploy a small app that opens up a few ports so I can connect to them and convert them using VMWare Converter. Thanks in advance, Clint. ...

Programmatically Printing in Adobe Reader 9 using .NET Interop

I am using VB.Net WinForms. I would like to call the Adobe Reader 9 ActiveX control to print some PDFs. I have added the ActiveX control to the VS toolbox (the dll is AcroPDF.dll, the COM name "Adobe PDF Reader". After some experiment the following code works. Dim files As String() = Directory.GetFiles(TextBoxPath.Text, "*.pdf", Sear...

Add 10000 to numbers using Regex replace?

I need to replace some 2- and 3-digit numbers with the same number plus 10000. So Photo.123.aspx needs to become Photo.10123.aspx and also Photo.12.aspx needs to become Photo.10012.aspx I know that in .NET I can delegate the replacement to a function and just add 10000 to the number, but I'd rather stick to garden-variety Reg...

Getting a sqlexception on successful insert, VB.NET

I'm trying to do a very simple INSERT using VB.NET. For some reason I'm getting a SqlException on every insert though. The data is inserted, but still get the following: Violation of PRIMARY KEY constraint 'PK_User'. Cannot insert duplicate key in object 'dbo.Employee'. The statement has been terminated When I check in SQL Managemen...

ListView with DataPager not working

From everything I've read, it seemed that adding paging to a ListView control should be dead simple, but it's not working for me. After adding the ListView and DataPager controls to the form and wiring them together, I'm getting very odd behavior. The DataPager correctly limits the ListView's page size, but clicking the paging buttons do...

XmlReader - Read Current Node as string

In the following snippet, using XmlReader, when I encounter an element. I would like to read it as-is, including all attributes and namespace decoration in the element. Using the oXml.Name property, I am only able to get the tag name. Is there a function to get the tag itself? oXml = XmlReader.Create(path, oXmlSettings) While oXml.Read(...

How to implement BaseValidator and IValidator in custom control - ASP.Net

I have a custom control that inherits from WebControl and implements IValidator, but I also want to have a property for ValidationGroup. From research, it appears I need to inherit from BaseValidator to do so. Can anybody provide a successfull example from a ASP.Net custom control that implements both BaseValidator and IValidator? ...

custom button captions in .net messagebox?

Is there an easy way to display a messagebox in VB.Net with custom button captions? I came across this, in the SO archives, but it's for managed C++ http://stackoverflow.com/questions/77293/what-is-an-easy-way-to-create-a-messagebox-with-custom-button-text-in-managed-c ...

Using the typical get set properties in C#... with parameters

Hello, I'd like to do the same in C#. Is there anyway of using properties in C# with parameters in the same way I've done with the parameter 'Key' in this VB.NET example? Private Shared m_Dictionary As IDictionary(Of String, Object) = New Dictionary(Of String, Object) Public Shared Property DictionaryElement(ByVal Key As String) As...

Accessing members of the other half of a partial class

I'm just learning to work with partial classes in VB.NET and VS2008. Specifically, I'm trying to extend a LINQ to SQL class that was automatically created by SqlMetal. The automatically generated class looks like this: Partial Public Class DataContext Inherits System.Data.Linq.DataContext ... <Table(Name:="dbo.Concessions")> ...

DataGridView combo box

How do you access the items collection of a combo box in a specific row in a DataGridView? I'm populating the combo as follows: Dim VATCombo As New DataGridViewComboBoxColumn With VATCombo .HeaderText = "VAT Rate" .Name = .HeaderText Dim VATCol As New JCVATRateCollec...

"Microsoft.ACE.OLEDB.12.0 provider is not registered" [RESOLVED]

I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb. In the database project I have a function which retrieves a data ...

VB.NET How Do I skin a vb.net app

I want to skin a vb.net app I made ive googled some stuff and I've seen skinned vb.net apps. However it seems like any time i try to find someone explaining it its a link to a pay for product. Does anyone have anything useful on this? ...

VB.NET WMI OR WQL? Help

I have an application that when it first starts i need it to run a database query. I have all the database queries however forms are all loaded by this method. dim myfrm as new Form2 myfrm.show. The thing is if this app has crashed etc i need to make sure its the first initial start of this program Does anyone have any ideas? ...

Threads Manager

Im looking to build a thread manager for an application. I have already started threading and it works entirely fine but I would like to be able to programatically kill them or get information on them. Does anyone have ideas? ...

How to deal gracefully with null foreign keys in Linq to SQL?

In my database, Concessions have a many-to-one relationship with Firms (each Concession has a FirmID). SqlMetal has captured this relationship and generated the appropriate classes, so that each Concession has a Firm element. I'm binding against a query (simplified here) that returns a list of Concessions along with information about the...

Preventing Users from Working on the Same Row

I have a web application at work that is similar to a ticket working system. Some users enter new issues. Other workers choose and resolve issues. All of the data is maintained in MS SQL server 2005. The users working to resolve issues go to a page where they can view open issues. Because up to twenty people can be looking at this page ...

What is the best mock framework for VB.NET?

What's the best mocking framework syntax-wise and capability-wise ? My problem: Most mocking frameworks use lambda expressions now, which are really ugly to write in VB.NET, so is there any framework that has nice syntax without lambdas or has fluent syntax that doesn't need lambdas? ...

Should this property be part of my object's interface?

I have a property called "IsSecureConnection" that is part of my object's interface. This makes sense for most implementations of the interface, however, in some implementations I would like to make the property ReadOnly. Should I omit this property from the object's interface even though it is required by all of the implementations ...