vb.net

What is difference between And and Andalso in VB.net ?

In Vb.net, What is difference between And and Andalso. Which should use in coding? ...

What is the " := " operator in (VB).NET or what is it good for?

I see this from time to time and want to know what it is. I did try google, but its filtering out the characters from the search. I have a few books that don't reference it either. FWIW, I remember in pascal that is was the assignment operator. Can anybody point me to the MSDN or similar page? ...

Best Way To Find Pattern 6 digit space 7 digit ###### ####### with VB.NET

Parsing a text file in vb.net and need to locate the latitude and longitude in these two sections of text. The patter is 6 digits space 7 digits (364800 0953600). The samples are from two different map files and have slightly differing formats. I 2H02 364800 0953600 ' SEC72 10496300- I 2H05 36...

RegEx no match in VB.NET

Hi folks I am making a mp3 id3tag editor, and a regex is not matching. Could anyone help me please? my code: arquivo = "[coletanea] album [CD #] [faixa] [artista] musica.mp3" r = New Regex("^\[(?<1>[^\]]+?)\]\s*(?<2>[\w\s]+)\s*\[CD\s*(?<3>\d+)\]\s*\[(?<4>\d+)\]\s*\[(?<5>[^\]]+)\]\s*(?<6>.+)", RegexOptions.Compiled) m = r.Match(Mid(arq...

Problem inserting multiple rows quickly to Oracle database from VB

I'm trying to insert multiple rows, one after another, to a database. Here is the relevant code. Private ConnectionString As String = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=xxx)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx;" Private SQ...

C# vs VB.NET - Handling of null Structures

I ran across this and was wondering if someone could explain why this works in VB.NET when I would expect it should fail, just like it does in C# //The C# Version struct Person { public string name; } ... Person someone = null; //Nope! Can't do that!! Person? someoneElse = null; //No problem, just like expected But then in VB.NET...

XML Deserialization Issue

I have the following xml that's sent to me from a web service. I'm using .NET to deserialize it, but I'm getting an exception saying that its formatted wrong. There is an error in XML document (2, 2) Now, if I understand that correctly, it's not liking that it's finding the first <error> node. <?xml version="1.0" encoding="UTF-8"?> <m...

VB.NET Read current line in a text area?

I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have. Private Sub HighLight() Dim rm As System.Text.RegularExpressions.MatchCollection Dim m As System.Text.RegularExpressions....

Function overloading vs. default parameters in VB.NET?

In VB.NET, which is better to use: function overloading or default parameters? ...

Is it legal and possible to access the return value in a finally block?

I wish to set a usererror string before leaving a function, depending on the return code and variable in the function. I currently have: Dim RetVal as RetType try ... if ... then RetVal = RetType.FailedParse end try endif ... finally select case RetVal case ... UserStr = ... end select end try ret...

Locate Pattern the Letter I followed by a space then three alpha numerics followed by a space

Need to locate the following pattern: The letter I followed by a space then three alpha numerics followed by a space "I ALN " "I H21 " "I 31M " these items are also followed by a lat/lon that is trapped by this expression: Dim regex As New Regex("\d{6} \d{7}") Can the expressions be combined to return a match that would look like: ...

Configuration Information for dlls in .NET

I have inherited a project that has class libraries written in VB.NET, some of these have ".settings" files and the others have a ".dll.config" file to store connection strings. What is the difference between these 2 methods? EDIT: In what scenarios would I prefer one over the other? ...

Determining what process has a lock on a file

I have a unit test that works fine locally but when uploaded to TeamCity build server fails with "The process cannot access the file because it is being used by another process." Before I do anything in the Test I check in the setup if the file exists and if so try to delete it. This fails with the same error message as above When wri...

best way to store / lookup name value pairs

I have a list of error codes I need to reference, kinda like this: Code / Error Message A01 = whatever error U01 = another error U02 = yet another error type I get the Code returned to me via a web service call and I need to display or get the readable error. So I need a function when passed a Code that returns the readable des...

VB.NET and ASP.NET DLL line numbers don't appear in production error logs

I can see line numbers in my error logs in our development environment, in which VB.NET 2005 and ASP.NET components are compiled in debug mode, with PDB files copied to the server on deployment. I don't see line numbers in production, where things are compiled in release mode, and presumably no PDB files are created or deployed? Can som...

What is the best way to provide "search as you type"?

I'm porting a Forms app to a VB.NET web app, and one of the feature the users really liked was the ability to narrow the possible choices as the user typed in a search box. The search itself goes against multiple tables and columns (and takes several seconds), so it's not a simple AutoComplete or anything. What's the best way to allow th...

How do I filter all HTML tags except a certain whitelist?

This is for .NET. IgnoreCase is set and MultiLine is NOT set. Usually I'm decent at regex, maybe I'm running low on caffeine... Users are allowed to enter HTML-encoded entities (<lt;, <amp;, etc.), and to use the following HTML tags: u, i, b, h3, h4, br, a, img Self-closing <br/> and <img/> are allowed, with or without the extra spa...

Learning C# help or hinder VB.NET learning

Hi I have just moved job and gone from VB 6 to VB.Net and found the learning jump fairly steep, have more a problem with the object / conceptual side of things .. but getting there now ... but as I was a assembler / C++ 10/15 years ago and was considering learning C++/C# .Net (XNA games library calls my name) but not sure if it would hi...

Why C# append get on property in class written in VB.net?

If we make any class in VB.NET and try to access its property in C# by making object of that class. get_ is appended in the property. Can any one please explain the reason. ...

Convert a multi page Tiff to jpeg in .Net1.1

Is there a way to convert a multi page Tiff file to a jpeg file in VB.net 1.1. I've tried to convert it with the standard Bitmap.Save() method but it only converts the first page. ...