vb.net

Appending to new line

Hi i have the following code which appends a text base file knowen as a .pgp file; all works fine except that everytime i launch this app i append the text in one continual line i need the text to appned to a new line eveytime it is used. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Butto...

C# -->Go to Definition ==> VB.NET

I have a solution in VS 2010. There are two DLL projects: one UserControl in C# WPF (myCSharpUC) and other - WinForm UserControl in VB.NET (myVbUC) Actually in myCSharpUC I have an instance of myVbUC: myCSharpUC { private MyVbUC vbControl; ... somemethod() { vbControl.MyProperty } } Is there a way to "nav...

MSXML The system cannot locate the resource specified

I have a function which uses MSXML to post an Xml document which yesterday started failing despite no change being made to the code. The function is as follows: Public Function PostFile(ByVal address As String, ByVal data As Byte()) As xmldocument Dim xmlHTTP As New MSXML2.XMLHTTP Dim response As New XmlDocument Dim xmlDoc...

Added reference, class is still not defined?

I have a web site project where I need to use the System.Security.Cryptography.Xml.SignedXml class. I added the Dll System.Security as a reference and imported the namespace into my project. It compiles successfully but when I debug the project I get a compilation error: Compiler Error Message: BC30002: Type 'System.Security.Cryptograp...

Unity Container Type Registration Quirk

Hi All, I'm trying to automatically register all reports in a unity container. All reports implement IReport and also have a Report() attribute which defines the title, description and unique key (so I can read these without instantiating a concrete class). So... I get the report types like this Public Shared Function GetClassesWhic...

How to save Bitmap as icon?

Hi! I need to save Bitmap object loaded from image file (.png, .jpeg, .bmp) and save it as an icon (.ico) to a separate file. First I tried saving Bitmap object to a file with Icon ImageFormat: using System.Drawing; Bitmap bmp = (Bitmap)pictureBox1.Image; bmp.Save(@"C:\icon.ico", Imaging.ImageFormat.Icon); This one fails, as the ic...

How can I dynamically create the condition clause for a LINQ where clause (generic type and dynamic property)

Here is my code: I thought using DLink I should be able to pass the where clause as string expressions however the FindFirstOrDefault doesn't work. Basically, I want the FindFirstOrDefault to be generic so I can pass any object, its key property and value and it should find it. Any ideas? <TestMethod()> Public Sub TestExpression() D...

Returning Json Result with object name MVC

When a json result is returned by the controller the object name seems to be missing, I normally wouldn't mind but the flexbox jquery plugin requires the json result in a particular format. Flexcombobox expected format {"results":[ {"id":"1","name":"Ant"}, {"id":"2","name":"Bear"}, {"id":"3","name":"Cat"}, {...

How to change Primary DNS Suffix of a computer in .NET?

Hi all, I'm working on an auto-configure app for new PC's. I managed to programatically set all the needed parameters, except Primary DNS Suffix of a computer (please remember that this is different from the network connection default DNS suffix). Any help? Update: Here's requested class for setting IP, Subnet, Gateway, and DNS of the...

Class 'clsGetHeaderValue' cannot be indexed because it has no default property.

I am getting a strange error when I try to build my solution. The error occurs when I am calling the oGetHeaderValue function and passing the parameters. Dim oGetHeaderValue As New clsGetHeaderValue Dim returnString As String returnString = oGetHeaderValue(strInvoiceNumber, strOrderNumber) The error message is: Class 'clsGetHeaderV...

reading XMl from stream

I have a continous stream setup and I tried just reading the data into a buffer but since the stream does not allow seeking I cannot determine the size of the stream at a time. I want to capture the xml by grabbing the opening element and continue reading till I have the closing element. I have tried using xml textreader but I get errors...

VBA wont append http:// to text based file?

hi, i need the following line to write START http:// in vba however it wont write ithe http:// part to the pgp (text based) file whats the trick for this? objWriter.WriteLine((TextBox5.Text) + "," + " " + "START http://" + (TextBox6.Text) This is the rest of the code if nesesary: Public Class Form1 Private Sub Button1_Click(ByVa...

Moving from ASP, business logic trapped inside stored procedures...

How would you structure a large project with most of the business logic already inside stored procedures? Here is a little bit of background : We are moving from classic ASP to ASP.NET (VB) and pretty much all the business logic is inside stored procedures. Getting the logic out of there is pretty much impossible since my boss doesn't ...

Deploying app to production using Debug Mode rather than Release Mode?

I work for a shop that maintains a fairly new app. The app still has its fair share of bugs, with numerous tickets coming in daily. The error information we're given with those tickets is not as useful as it might be because the application was compiled in Release mode, which I read is smaller and faster (makes sense). Are there any r...

How to call a C# class's static method from VB.Net?

I have a C# dll and want to use it in VB.NET. I'm using C# 2008 Express and VB 2008 Express. I have added a reference in a VB project to the C# dll. When I create an instane of a class in the C# dll, it gives the following error messsage: "Type 'RF.RabinFingerprint' has no constructors". How do I fix this? My C# dll code: using System;...

A simple VB.net SQL data query that is not returning any records

I am trying to debug my code, which involves a simple webservice that passes parameters to a data class, which calls a stored proc, and returns one row of record. I am not getting any error messages, but I am not getting any records back either. My webservice code is: <WebMethod()> _ Public Function GetDataValues(ByVal AutoVIN As Str...

Implementing a C# interface in a VB class

I am working on a plugin architecture and after some reading I have settled on one. The host class will be implemented in C# as well as some of the plugins for that host. The issue I am having is that some of my team uses VB.net. So the question, is it possible to implement a C# (plugin)interface in VB, such that when it is dynamically l...

"An unexpected network error occurred." happens occasionally, unable to isolate

I have a VB .NET Application which I have written for my company which occasionally throws a message “System.IO.IOException: An unexpected network error occurred.”, that I have been unable to figure out the issue. The application is a Backup program which to simplify for this post does the following: 1) Checks for H drive or external d...

How to resolve the domain server name from .NET

Hi In a single server Windows domain, does anyone know how to get the servername. For example, in my test environment, we have a single Windows Small Business Server 2008 called horatio, it is the domain controller for longtest.local. I have played around with the system.dns (with no positive results) : Dim myIP As IPHostEntry = Dn...

Vb.net Exception

I have just converted my c# code to vb.net. And it is giving exception. c# code : private static short[] muLawToPcmMap; decoded[2 * i + 1] = (byte)(muLawToPcmMap[data[i]] >> 8); vb code : decoded(2 * i + 1) = CByte(muLawToPcmMap(data(i)) >> 8) Exception : Arithmetic operation resulted in an overflow. I am in very much trouble....