vb.net

VB.NET: How can I remap the soap.location property of a web service at runtime?

I have a web application I'm deploying at multiple clients. Each client will be consuming a web service that was developed by a third party and is hosted at each client location. The soap.location will be different for each deployment. I am looking to avoid having to do separate compiles foe each client. This blog post has a potentia...

How can I add a 'test service' page to a WCF Webservice in VB.Net

I am building a Web service using WCF as a way to provide access to data within my VB.Net application. When building web services hosted on IIS, there is a helpful test page as part of the service that allows the webservice to be invoked with parameters there and then. It's very helpful for testing. Is there a way to configure a WCF ho...

Threaded loading (waiting) screen

I'm looking for a generic method to implement a wait screen during long operations. I have used threading a few times before, but I have the feeling that I implemented it either very poorly, or with way too much hassle (and copy/pasting - the horror!). I want to keep this as generic and simple as possible, so I won't have to implement l...

How to add records in datagridview vb.net

Hi How to add new record to datagridview control in VB.net, I don't use Dataset or database biding at all, all I have is small form with 3 entries, when the user click OK, that will be added to the datagridview control as new row. Thanks ...

VB.NET Controls inside of a DataGridView Row on a Windows Form

I have a ComboBox inside of a cell of a DataGridView Row on a Windows form. I need the following to happen: click on the ComboBox pick a value recalculate a total & display inside of a lable that is sitting outside of the DataGridView. Currently, the following is happening: Click on the ComboBox Click it again to open the ...

Why would Visual Studio/CLR produce a "bad" executable?

This is a weird problem I have started having recently. My team is developing a COTS application and we have a few people with their hands in the code. A few weeks ago, I received an error message when trying to debug (and run the compiled EXE): "Windows cannot access the specified device, path, or file. You may not have the appr...

Getting an Average over Multiple Collections in LINQ

I have a collection of collections, all the child collections have the same number of elements. The parent collection does nothing other than hold the child collections. [0] [Child_0] [ID: 1] [0] [Child_0] [Amount: 4] [0] [Child_1] [ID: 2] [0] [Child_1] [Amount: 7] [1] [Child_0] [ID: 1] [1] [Child_0] [Amount: 2] [1] [Child_1] [ID: 2] [1...

Why does this cause Windows Authentication to appear and not an exception?

Ok, so after spending a good portion of a day debugging a stupid typing mistake inside a piece of code I am curious as to why the specific actions occured rather than an exception. First of all the problem code. Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn Dim hl As New HyperLink AddHa...

Referencing code in VB.NET

I'm not at all familiar with VB.NET or ASP. I need to create a simple page which makes a call to a remote web service. I used the wsdl utility which comes with the DotNet SDK to generate a service proxy and write it to a VB file. Unfortunately I have no idea how to reference this code in either my ASPX file or the code behind VB file so ...

To protect software by accessing harddisk serial no

I want to get the VB.NET or VB code to access the hard disk serial no when starting the program. It's to help me to protect my own software from people who try to pirate copies. ...

are conversion operators only applicable to numeric types .net

Hi, I was wondering whether overriding conversion operators is only applicable to numeric types? If not in what instances would the implicit or explicit conversion operator be applicable to other value types or reference types. An example would be great. Thanks ...

Which is better apply two conditions in nested If or using single with And ?

Nested If or single if with And operator, which is better approach? Single If with And if (txtPackage.Text = !string.Empty && txtPackage.Text == "abc") { // } Nested If if (txtPackage.Text = !string.Empty) { if (txtPackage.Text == "abc") { // } } ...

binding to linq inherited types in asp.net

Hi I have a datammodel in linq to SQL that includes a type "Party" which is sub classed twice for "Company" and "Individual". I am trying to bind two repeaters to linq to sql queries as follows Dim oComp As IEnumerable(Of Company) Dim oInd As IEnumerable(Of Individual) oComp = From oP As Company In ERM.Parties _ ...

How to open a password protected shared network folder using VB.NET?

I need to open a password protected shared folder on a network to gain access to an Access 97 database. How do I open the folder and pass in the password? Thanks, ...

.Net FormStartPosition.CenterScreen not centering

Hi Everyone, I am trying to center a form in VB.net. Instead of centering the form, it ends up about halfway between center and 0,0(upper left). I am using the code Me.StartPosition = FormStartPosition.CenterScreen Which is called from the IntializeDisplay Method, which in turn is called from the Form Load method. I assume I'm se...

How do I debug IL code generated at runtime using Reflection.Emit

Hi, I am trying to generate some code at runtime using the DynamicMethod class in the Reflection.Emit namespace but for some reason its throwing a "VerificationException". Here is the IL code I am trying to use... ldarg.1 ldarg.0 ldfld, System.String FirstName callvirt, Void Write(System.String) ldarg.1 ldarg.0 ldfld, System.String Las...

what's the difference between declaring as new and as something = new something in vb.net?

I have see code like this Dim s as something = new something Dim s as new something what's the difference? is there any? ...

Drag and Dropping an Object Reference VB.Net

I am trying to 'swap' two cells' contents, and their mappings. To do this, I need to drag and drop a reference to the cell as opposed to the string value itself. I can then use this reference to update a Dictionary as well as get the value. It allows allows me to do the swap as I will have a reference to the old cell to add the value nee...

Killing an interop Application process

I have the following in a program (written in VB.NET): Imports Microsoft.Office.Interop.Excel Public Class Form1 Dim eApp As New Excel.Application Dim w As Excel.Workbook w = eApp.Workbooks.Open( "path.xls", ReadOnly:=True) .. Processing Code .. //Attempts at killing the excel application w.Close() eApp.Work...

Populate Property Object during Property Call

Hello all, I'd like to know whether this approach is correct or if their are better ways of doing this. I have what is basically a Person class which has a number of other classes as variables, each of the custom classes is instantiated by passing the Person ID and then that class retrieves the data it needs using that ID. I expose the ...