vb.net

MD5CryptoServiceProvider ComputeHash Issues between VS 2003 and VS 2008

I have a database application that generates a MD5 hash and compares the hash value to a value in our DB (SQL 2K). The original application was written in Visual Studio 2003 and a deployed version has been working for years. Recently, some new machines on the .NET framework 3.5 have been having unrelated issues with our runtime. This h...

Spaces in C# Enums

Is there any way to put spaces in a C# enum constant? I've read that you can do it in VB by doing this: Public Enum EnumWithSpaces ConstantWithoutSpaces [Constant With Spaces] End Enum ...and then access it like this: Public Sub UsingEnumWithSpaces() Dim foo As EnumWithSpaces = EnumWithSpaces.[Constant With Spaces] End Sub ...

resources in VB2005.net?

In short my program plays a random embedded audio file when a timer runs out, is there a way to refer to the my.resources files as an array and use them that way rather than needing to know the exact file name of the resource? ...

how to get an icon to appear next to the clock?

i built a small app in vb.net and i would like my icon to appear next to the computer clock in the taskbar. how can i do this? ...

show / hide form when cursor is in the top left corner

i have a little form that looks like this in vb.net http://img11.imageshack.us/img11/5651/samplennk.jpg you know how you can set the windows taskbar to appear and disappear when the position of the mouse is all the way at the bottom? i want to do the same thing with my form when the mouse is in the top left corner of screen. or perhap...

detecting a mouse click that is outside of the form

i would like my form to dissappear when the user clicks outside the form in vb.net. how do i do this? ...

how do i prevent a form from being resized by the user?

i have a form that needs to be maximized in vb.net. i dont want the user to be able to change its size or move it around. ...

Linq to SQL error when doing a Lambda

The following lines of code is producing this error: "Overload resolution failes because no accessible 'Single' can be called with these arguments". I'm not too good with VB, but since the app I've inherited was in VB, I didn't want to rewrite it all: Dim a1 = From rows In db.tPDMLinkUsages _ Where (rows.ACCESSDATE >= DateTime.Today...

SyncLock on SyncRoot

I have created a synchronized queue and am using SyncLock on the SyncRoot property of that queue when I invoke the Enqueue/Dequeue methods. The methods are invoked from instances of standard producer/consumer classes. Is that a proper use of the SyncRoot property? Would it be better practice to create a private shared object in each c...

How to Generate Combinations of Elements of a List<T> in .NET 4.0

I have a question that is similar, but not identical, to the one answered here. I would like a function generate all of the k-combinations of elements from a List of n elements. Note that I am looking for combinations, not permutations, and that we need a solution for varying k (i.e., hard-coding the loops is a no-no). I am looking fo...

Microsoft Data Access Application Block Date type precision

We are working on an ASP.Net/VB.Net application using Enterprise Library for our data access (DAAB). We are trying to store DateTime values in an Oracle Date field. However, the precision is being lost. Currently only the year, month, and date are being stored. We need better precision than this. Oracle Dates are supposed to "includes...

(.net) DefaultMemberAttribute - what does it do?

Hello. I've already read the MSDN article about it. It seems internally it is the way c# sets which is the function that is going to work as indexer(am I right?). Now, I've seen the following example: [DefaultMemberAttribute("Main")] public class Program { public static void Main() { ... } } Now, I don't get it what i...

Sending output to stdout (console) in a VB.NET win form project

I have an application with a String variable that repeated gets a Date from a database, does something with that field, then goes onto the next row. Is there a way I can send send out some debugging information to the stdout console so I can debug better/view the progress of the program? ...

Easy way to write a string with control characters to an nvarchar field in a DB?

EDIT: Accepted answer points out what my issue was. I added another answer which shows an even easier way. I have a multiline textbox from which I create a single string: Dim wholeThing As String Dim line as String For Each line In txtMultiline.Lines wholeThing = wholeThing & line & Environment.Newline Next ...

Retrieve lost data from log file?

I have an asp.net/vb file that receives data and processes it via a stored procedure. The code had the width set to 2 for the year's varchar, so it was chopped, leaving only the first two digits to get inserted into the db. Is this info possibly retrievable from a system/IIS log file or is it lost forever? thanks! ...

Nullable Types in VB.NET?

Can Nullable Types be used in VB.NET? If so, is it possible to have a Nullable Integer that I can use with a field that accepts NULL in SQL Server? Examples would be appreciated. ...

Elevation without restarting an application?

Has anyone managed to get administration rights through the UAC without restarting the application or embedding a manifest file? I'd like to write to some files that only administrators can modify, without relying to another elevated application. Is it possible to impersonate an administrator previously calling with some native API the ...

Why isn't MVC using Error.aspx?

I'm trying to add some security to my ASP.NET 1.0 MVC app (VB), but I can't get it to work. At the top of my controller, I've got: <HandleError()> _ Public Class HomeController I'm overriding OnActionExecuting and throwing a SecurityException if the user is not in the proper role. Everything I've read states that this should by defau...

When does it make sense to use F# over C# or VB.NET?

Does anyone have any practical examples where F# would be a better choice than C# or VB.NET? Please can you demonstrate using source code? ...

Crystal Report in vb.net application showing blank page.

I have a crystal report that works in Crystal Reports Writer XI just fine. I run the report in the application passing the same information that I use to test in the CR Writer and the report is completely blank. No exceptions what so ever are raised in the application. I've opened the report in VS2008 and resaved it and verified the d...