vb.net

A checklist for fixing .NET applications to SQL Server timeout problems and improve execution time

A checklist for improving execution time between .NET code and SQL Server. Anything from the basic to weird solutions is appreciated. Code: Change default timeout in command and connection by avgbody. Use stored procedure calls instead of inline sql statement by avgbody. Look for blocking/locking using Activity monitor by Jay Shepher...

lambda expressions in vb.net

Hi, I have something that is driving me absolutely crazy... Public Function GetAccountGroups() As IList(Of AccountGroup) Dim raw_account_groups As IList(Of AccountGroup) raw_account_groups = _repository.GetAccountGroups().ToList() Dim parents = (From ag In raw_account_groups _ Where ag.p...

Is there a way to programmatically minimize a window in .NET

What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the form. ...

vb6 to vb.net declaration

How do I declare "as any" in VB.NET, or what is the equivalent? ...

Single Form Hide on Startup

I have an application with one form in it, and on the Load mehtod i need to hide the form. The form will display itself when it has need to (think along the lines of a outlook 2003 style popup), but i cant for the life of me work out how to hide the form on load without something messy. Any suggestions? ...

VB.Net Tutorials

My company's moving to VB.Net in the near future and I need to make the move from "Classic" ASP (i.e. VBScript) I've had a look at www.asp.net but most of the tutorials appear to be in video format which I can't access at the office. And I'm currently looking at http://www.dotnetjunkies.com/quickstart/aspplus/doc/quickstart.aspx Ideall...

What is the null value of Nullable(Of T) ?

I have a nullable property, and I want to return a null value. How do I do that in VB.NET ? Currently I use this solution, but I think there might be a better way. Public Shared ReadOnly Property rubrique_id() As Nullable(Of Integer) Get If Current.Request.QueryString("rid") <> "" Then Return CIn...

Which is generally best to use -- StringComparison.OrdinalIgnoreCase or StringComparison.InvariantCultureIgnoreCase?

If I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then ' .. do something .. And I don't care about the case, should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, or CurrentCultureIgnoreCase? ...

Silverlight- DataGrid control - Selection Changed event interfering with sorting

I'm currently playing with the Silverlight(Beta 2) Datagrid control. Before I wired up the SelectionChanged event, the grid would sort perfectly by clicking on the header. Now, when the grid is clicked, it will fire the SelectionChanged event when I click the header to sort. Is there any way around this? In a semi-related topic, I'd ...

How to write static code analyzer for .net

I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start. ...

how do i take picture from a digital camera attached to my computer throught USB cable using vb.net or asp.net or C#?

I am writing picture editing windows forms application using vb.net/c#. i have a client requirement to capture the photo from digital still camera attached to computer. how can i capture a photo from USB connected digital still camera device in my windows application ? ...

How do you get a string from a MemoryStream?

If I am given a MemoryStream that I know has been populated with a String, how do I get a String back out? ...

Open .NET form in designer mode - get "The path is not of a legal form"

I attempted to open a C#/VB form in designer mode, and instead of the form, I got an ugly error message saying "The path is not of a legal form". This form used to work! What happened? Thanks to all who have answered. This question is a problem I hit a while back, and I struggled with it for a long time, until I found the answer, w...

When should a class member be declared virtual (C#)/Overridable (VB.NET)?

Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual? ...

Building a query string based radiobutton values

I'd like to build a query string based on values taken from 5 groups of radio buttons. Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1 The asp:Radiobuttonlist control does not like null values so I'm resorting to normal html radio button...

How do get element out of xml file

From a service i get a xml-file. Now I want to get one of those element out of the file. I think I should go into some xpath - any good starter reference ? ...

Dockable Form

How do you create a "dockable" form, similar to the windows in Visual Studio? ...

XML node name clean up code

I am trying to create an XML file based on data fields from a table, and I want to have the nodes named based on the value in a field from the table. The problem is that sometimes values entered in that column contain spaces and other characters not allowed in Node names. Does anyone have any code that will cleanup a passed in string an...

RIghtFax Esoteric error message in .NET 1.1

I have a problem with rightfax component Interop.RFCOMAPILib.dll version 1.0.0.0 , using VB .NET 1.1. It works in severals enviroments , but it doesn´t in Production. It returns this message in the exception - "?" - . How i solve it? i couldn´t find any solution in manuals or internet . Thanks! ...

Error BC30002 - Type XXX is not defined

OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code. The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message : Error BC30002: Type ‘XXX’ is n...