vb.net

VB.NET / VSTO2008 fails; can't find runtime.

I'm trying to deploy a VB.NET app which is an extension to Excel using VSTO. It works fine in the development environment, but when someone else (without a dev environment installed, just the .NET framework) installs it, they get: The common language runtime could not be loaded by <application>. Contact your administrator for furthe...

SMTP Headers in VB.Net without Redemption

I'm writing a mail component for a VB.Net app, and need to handle mails differently that are "Sent on Behalf" of someone. Although the Outlook Object Model exposes "SentOnBehalfOfName", it doesn't expose the email address for that party. Supposedly it's in the "OtherHeaders" field of the SMTP header, but I don't see an easy way to get ...

Reading Object's Memory Address

I'm trying to pass a business object from one WinForm to another WinForm for modification, and then repopulate the text boxes, etc. on the first form with the updated values. However, it seems that the object values set in the second form are not "sticking" when the code control returns to the first form. Is there a way to view the me...

UnauthorizedAccessException in Vista from frequent file I/O with .Net 2.0

At work, we have migrated from Windows XP to Windows Vista. After the migration, some of my unit tests, using nUnit, started to randomly fail with the System.UnauthorizedAccessException being thrown. The failing tests each involve writing files used for tests stored as embedded resources in the test DLL to the current directory, runnin...

VB.NET Open word document

In VB.NET how do you open a word/PDF doc? I used to have the code and I remember it was very short. ...

How do I rebind a combobox in winforms?

I have a Winforms application and a combobox has it's datasource set to a DataTable when the form loads. The data displays fine in the combobox. Then after a user clicks a button I want to create a new DataTable and assign that datatable as the datasource for the combobox. The problem is that after setting the datasource to be the ne...

Why is this looping infinitely?

So I just got my site kicked off the server today and I think this function is the culprit. Can anyone tell me what the problem is? I can't seem to figure it out: Public Function CleanText(ByVal str As String) As String 'removes HTML tags and other characters that title tags and descriptions don't like If Not String.IsNullOrEmpty(s...

Find/Replace Word Puzzle

Let's say I have an object that contains a Word property and a Sentence property. The sentence must use the word, and I want to replace the word in that sentence with a link using a public function (say, GetLinkedSentence). The catch is maybe the sentence uses a plural form of the word and maybe the "word" itself is actually a phrase, or...

How do I use regex to replace non-word chars in a specific piece of string?

I have text file with a row like this: SendersTimeSeriesIdentification: COMPANY_A/COMPANY_B/REF_7/20090505 I'd like to replace all non-word chars in the value part with the character n, like this: SendersTimeSeriesIdentification: COMPANYnAnCOMPANYnBnREFn7n20090505 But there are similar strings all over the file, which must remain i...

Some form of Progress bar when something is loading in ASP.NET?

Is there a easy way to show some form of progress bar on your form in ASP.NET that the code is busy running in the background (meaning thinking)? Like the default I.E have the small little window on the top that moves when its thinking.......... I have done this before with Ajax but its alot of work and my site is not a Ajax enabled sit...

Disable GZIP compression for IE6 clients.

We need to conditionally disable GZIP compression if user's browser is IE6 (it hangs browser for 5min) in few pages of larger site. Server is IIS7 and has compression for static content turned on - want that compression left working if user agent is not Mozilla/4.0. ASPX code sample anyone? Alternatively, code to conditionally redirect ...

order by not working

I am using an objectdatasource with a gridview to get data from my orm class, but I cannot get it to order by properly. I am using the code below but it does not come up in descending order like I have specified below. What am I missing? Using subsonic 2.1 <DataObjectMethod(DataObjectMethodType.Select, True)> Public Function FetchByP...

IE8 Local HTML File - "System cannot find the specified file."

We're writing a Windows client application in VB.NET. On the first launch of the application it loads a local HTML file "User Guide" for the user to get acquainted with the new software. There is also a menu option to access the content which also produces the same error. Whenever the page is launched, a dialog box appears stating that "...

Webresource.axd? - 500 internal server error

Hi All, im trying to use a file upload control from the obout control library, i really like it, and think its quite slick without any flash!.. i downloaded the entire installer, played with the settings in the samples, and made the control act exactly as i wanted. i created a brand new web application ins vs2008, and included the web...

Databind() on gridview not working VB.net ASP.Net

I have a datatable with verified 10 rows named dtable. I attempt to bind it to my gridview and nothing shows up on my asp.net page. Why do these relatively simple few lines not populate my gridview? Dim con As SqlConnection = Nothing Dim dTable As DataTable Dim dataAdapter As SqlDataAdapter Dim sqlcmd As String .......

Trouble retrieving form values from VB

Hi, I've created a module for my website and when a button is clicked, it calls a VB sub on the server. I need this sub to retrieve the values that were filled in on the form, but the things I need to retrieve values from are not asp controls, they are simple <input> and <select> tags. How can I retrieve values from input on a .aspx p...

Results of Request.Form if the requested input is blank

Hi, When I use Request.Form("myInput") and the input field "myInput" is blank, I get a server error. How do I handle this? Is there a way to check if "myInput" has not been filled? ...

NullReferenceException with ToolTip.CreateHandle

We sporadically get errors when we try to update a tool tip, like this ToolTip.SetToolTip(myLabel, customDataStructure) The error we get is a NullReferenceException: Object reference not set to an instance of an object Does anyone know the cause of this? Is a simple Try/Catch that eats the NullReferenceException a feasible option? ...

Is this proper in .NET?

I am beginner in .NET. One of my firsts task is to change the meta tags dynamically for dynamically generated pages. So, I came up with this, but am not too sure on what is considered the "proper" way to do it in .NET. <head> <title><%= title %></title> <meta name="description" content="<%= MetaDescription %>" /> ... </head> This f...

VB.Net constructor order matters?

Why does constructor ORDER matter in VB.Net? I am building a .Net type library which is meant to wrap an underlying COM library completely so that the consumers of the API can pretend to use a nice .Net library with .Net collections and whatnot instead of a COM library. Currently most of my classes are just 1 to 1 wrappers built using R...