vb.net

Vb.net compact framework and Saving XML (app.config)

Hello... I am writing my first windows ce app. I am using an xml file (app.Config) to store state data... basically user preferences on the last location (connection string) that the person was using before closing the app. I am having trouble understanding what is happening on deploy. It looks like it is copying my xml file to the de...

guid to base64, for URL

Question: is there a better way to do that? VB.Net Function GuidToBase64(ByVal guid As Guid) As String Return Convert.ToBase64String(guid.ToByteArray).Replace("/", "-").Replace("+", "_").Replace("=", "") End Function Function Base64ToGuid(ByVal base64 As String) As Guid Dim guid As Guid base64 = base64.Replace("-", "/").Re...

Converting the rows of a returned DataTable object into a useful list?

I am currently writing unit tests for an application near completion (before management looks at it and turns it inside out). I am testing the business layer and a method is set to return a datatable of all "GroupID"s, which are simply an integer to represent the group that a user belongs to. I'm assuming the best way to assert on this...

Another LINQ to XML (C# to VB.NET conversion)

What is the VB.NET syntax for these? Any help converting would be greatly appreciated. var defaultStyleName = (string)doc .MainDocumentPart .StyleDefinitionsPart .GetXDocument() .Root .Elements(w + "style") .Where(style => (string)style.Attri...

Is there anyway to trap the event of MDI Child loading for the first time?

I'm trying to force an always maximize setting. Thanks ...

Add menu item to another application.

gAlwaysIdle is a windows application which will add a menu item to Gtalk context menu. How can I do this to an application using vb.net or c#.net? ...

Can't return Dictionary(Of String, String) via GET ajax web request, works with POST

I have the following web method: <WebMethod()> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True, XmlSerializeString:=True)> _ Public Function GetDictionary() As Dictionary(Of String, String) Dim d As New Dictionary(Of String, String) d.Add("key1", "value1") d.Add("key2", "value2"...

"Indirect reference is being made to assembly" Build Error

I'm on a team that manages two projects. The Plant project is a library project that is consumed by multiple groups, including my own. The Admin Client Project (which we are building for our client) consumes the Plant project and has it's own custom components. To integrate, we have a dependency folder in the AdminClient.Application p...

Optimising asp.net vb code behind

I have the below code.. i am finding a way to optimise it.. is there anyway to optimise it using findcontrol and loops ?? also eliminating headofficeSelected,areaSelected ,headofficeSelected and only using storeSelected ? If (storeSelected = 1) Then tempCollector = tempCollector + "<br>" + "Department" + ": " + txt_panview3_ddinpu...

default value of "value" in primitive types

primitive types (integer, string, etc) are now classes. However to access the value of the class you just use the object name (ex, x=y). It isn't necessary to refer to a property of the class (x.value = y.value). To implement an abstract data class (say inches), we need a value property so if we have dim x as inches (our class) we hav...

Can I dispose of these unmanged resources without requiring a reference to each?

I have a class bMainframe that manages the connections to 4 different mainframes. It allows for the same underlying unmanaged library to be opened in specific ways and more than one mainframe to be connected to at a time. Each library has its own disposal code for the unmanaged mainframe connection resource. The wrapper also has code t...

Creating a list of Anonymous Type in VB

I'd like to create a list of an anonymous type, for example: Dim dsResource = New With {.Name = dsResourcesEnd(index).Last_Name & ", " & dsResourcesEnd(index).First_Name _ , .StartDate = dsResourcesStart(index).Day _ , .EndDate = dsResourcesEnd(index).Day} I have created that ano...

VB.NET language and Nothing : why is it the way it is ?

This is a question about the VB.NET language. Since I am using it every day, I just try to understand the motivations behind some of its constructs. I just find out that this line : If myObject Is Nothing then is as correct as this one is : If Nothing Is myObject Then Same results. Using ildasm, we can see that these lines are tra...

How can I tell what user a VB.Net application is running as and how can I change it?

We have an app that needs to access network resources. It's written in VB.Net. The application can't access the files on another server via a UNC path. How can we find out what user the application is truly running as and how can it be changed? We tried this KB from Microsoft... but it didn't work. ...

Help with adding checkbox column to DataGridView in window form

Hi I am trying to add a checkbox column to a DataGridView in a simple window forms application. I am pulling back some data from a database using ADO.NET, putting into a datatable, and then setting the datagridview datasource to the datatable. I then want to add a checkbox column as the second column. So far I have this code that seems...

VBCodeProvider not honoring OptionInfer in providerOptions?

I'm trying to dynamically compile some VB code in my C# project and I'm running into an issue with the VBCodeProvider. It doesn't seem to be honoring the OptionInfer flag that I'm putting in the providerOptions Dictionary. My code looks like this: var providerOptions = new Dictionary<string, string>(); providerOptions.Add("CompilerVer...

Managed Code AddIn for Access 2003

Hi, I have created a Managed Code AddIn for Access 2003 using Visual Basic 2008 (VS Professional) and it works fine on my development machine. It was created using the Shared Add-in template. I used the set up project to install... and the .Net Framework was installed. However when I try to deploy to another PC I get the following er...

Rewrite the vb.net codebehind for asp webpage

Possible Duplicate: Optimising asp.net vb code behind I need to rewrite the below code : If (storeSelected = 1) Then tempCollector = tempCollector + "<br>" + "Department" + ": " + txt_panview3_ddinput1.SelectedItem.ToString tempCollector = tempCollector + "<br>" + "Store" + ": " + txt_panview3_input2.Text + "<br>" End ...

IHttpHandler for images producing a stackoverflow in IE

I have a directory of images that reside outside the context of my web application that I need to serve to the user. Currently I'm using an IHttpHandler to serve the images and using some javascript to navigate through a set of images (the navigation is primitive for now). I followed examples for using IHttpHandler to serve images closel...

Problem finding a control within a FormView from code-behind

Here the code behind... I'm trying to retrieve this control so I can add items to the drop down list (I'm retrieving the Role Groups to add to the drop down list in the code-behind) Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DDRoleGroups As DropDownList DDRoleGroup...