vb.net

How can I embed a PDF in an Email?

I've already referred to this: http://stackoverflow.com/questions/104177/how-do-i-embed-an-image-in-a-net-html-mail-message I've been embedding images using an AlternateView for PNG files. Now I'm wondering how to do it with PDFs. Should it work, for the LinkedResource, to just say: Dim document As New LinkedResource(pdfFilePath, "i...

VB.NET Dim vs. New

What are the differences between the following constructs? Why prefer one over the other? Dim byteArray(20) as Byte and Dim byteArray() as Byte = new Byte(20) {} Edit - Corrected the ReDim. Should be a Dim. ...

[LUCENE.NET] How to incorporate multiple fields in QueryParser?

Dim qp1 As New QueryParser("filename", New StandardAnalyzer()) Dim qp2 As New QueryParser("filetext", New StandardAnalyzer()) . . Instead of creating 2 separate QueryParser objects and using them to obtain 2 Hits objects, is it possible perform a search on both fields using a single QueryParser object, so that I have only on Hits objec...

Nunit results

I am using Nunit results for managerial view of all the tests. After reading nunit doc it says it automatically update the results xml file after running the tests. But In my case it keep showing me the old results in index file where as updated reults in actual file. Any idea how can I update the index file according to the latest resul...

CType equivalent on .NET Framework 2.0

In VB.NET CINT(VB.NET) is Integer.Parse in .NET Framework, what is the .NET equivalent for (VB.NET) CType? ...

Switching to Release Build causes runtime error in Web Reference

I've got a problem with a SOAP Web Reference that was generated by Visual Studio 2005 (.NET framework is v2.0.50727.42) - it works fine under the Debug build configuration (and has for months) but now that I want to go live and have compiled using the Release configuration, it has stopped working. Exceptions are raised at runtime whenev...

how to set the default encoding in windows XP ?

Hello, im trying to open a file using StreamReader and ive to set a Encoding, but i want it to take the Default Windows Encoding... how can i change my windows Encoding ??? ...

How do I move service references to their own assembly?

A little background: I'm creating a set of adapters to allow communication with mobile devices over different cellular networks. This will be achieved using a class factory pattern. At least one of the networks requires a service reference to communicate with their devices through a web service. So far I've got 3 assemblies so far wh...

ComboBox that remembers recently entered values and can autocomplete

I'm developing a Desktop Search Engine in VB.NET I'm using a ComboBox to specify the search query (string). I want the ComboBox to remember and display recent queries. I also want the ComboBox to try and Autocomplete the queries as the user is typing. What is the best way to implement this? ...

How do I convert from a possibly Windows 1252 'ANSI' encoded uploaded file to UTF8 in .NET?

I've got a FileUpload control in an ASP.NET web page which is used to upload a file, the contents of which (in a stream) are processed in the C# code behind and output on the page later, using HtmlEncode. But, some of this output is becoming mangled, specifically the symbol '£' is output as the Unicode FFFD REPLACEMENT CHARACTER. I've ...

running nunit summary after completion of NUnit tests in a batch file

I want to to run nunit summary.exe after successful completion of NUnit Tests assembly. I am calling nunit from a batch file and then I want to call nunit summary. Any idea how to do this ...

Calling Assembly to get Application Name VB.NET

Hi! I have a console application (MyProgram.EXE) that references a Utilities assembly. In my Utilities assembly, I have code that does: Dim asm As Assembly = Assembly.GetExecutingAssembly() Dim location As String = asm.Location Dim appName As String = System.IO.Path.GetDirectoryName(location) Conole.WriteLine("AppName is: {0}", appNam...

How to add common code (specifically to methods marked WebMethod())

I have some ASP.NET page and webservice WebMethod() methods that I'd like to add some common code to. For example: <WebMethod()> _ Public Function AddressLookup(ByVal zipCode As String) As Address #If DEBUG Then ' Simulate a delay System.Threading.Thread.Sleep(2000) #End If Return New Address() End Function ...

.NET : How to validate XML file with DTD without DOCTYPE declaration

I have an XML file with no DOCTYPE declaration that I would like to validate with an external DTD upon reading. Dim x_set As Xml.XmlReaderSettings = New Xml.XmlReaderSettings() x_set.XmlResolver = Nothing x_set.CheckCharacters = False x_set.ProhibitDtd = False x = XmlTextReader.Create(sChemin, x_set) How do you set the path for that e...

Main UI windows not updating control -Cross-thread operation not valid

Ok..here is the problem I have a main UI form that has a control container that i can add some buttons item to it,and also i have a backgroundworker object that starts up a listner. When the listner events fire, i would like to create a button in that control container on the main UI form. Everything seems to work fine until i try to ad...

Linq DataContext doesn't recover after a caught exception?

I am using LINQ for the first time and I am running into some behavior I don't fully understand with the DataContext. Hopefully StackOverflow can help. Basically, it seems like once my DataContext encounters an exception, it either caches that exception or never fully recovers. In my specific case, once I try to pass a string that is to...

Can I customize the intellisense value shown when hovering while debugging in visual studio?

When I hover over a variable in visual studio, it brings up a small control which shows the variable name, type, and a + box for viewing members, etc. But for some types the variable type is replaced by more helpful information such as "{X = 0.0 Y = 0.0 Width = 0.0 Height = 0.0}" for a RectangleF. Is there a way to specify what should b...

Is there any alternative to Application.DoEvents() for a web service.

Is there any alternative method to System.Windows.Forms.Application.DoEvents() to flush the event queue which doesn't use the System.Windows.Forms namespace? If not, is it ok to use the above method/namespace within a web service. ...

Use reflection to set a property value to Nothing (Null)

Edit: Based on the answer from LoveMeSomeCode, I believe this issue only appears in VB.Net. I'm trying to revert a class to a previous state by saving the old values of changed properties in a dictionary and setting them via reflection when I need to revert. I'm having a problem where if the old value is Nothing (null) I get a null refe...

Gracefully remove a datasource from VS VB 2008 project?

Hi there What is the best way to remove a data source you no longer need from a VB2008 project? Deleting the Data source in the Solution Explorer throws up loads of errors. Deleting tables in the design view of the Dataset designer throws errors. Deleting the Table Adapters at the bottom of the form throws up errors, and now my Toolbox...