|
How to check NULL value in .net ?
|
Total Hit (2860) |
IsNull() function of VB6 is not supported in VB.net to check NULL value but there is alternate way to do that
«Code LangId=2»
If rs("Myfield") IS System.DBNull.Value Then
Msgbox("It is NULL")
Else
Msgbox("It is not NULL")
End if«/Code»
|
Rating
|
|
|
Creating custom help filters
|
Total Hit (2722) |
If you open the VS.NET documentation (either from within the IDE or by clicking the respective icon under the Start | Programs| Microsoft Visual Studio 2003 folder) you can use the Filtered by dropdown box to select a filter, and load in the list/tree control below only the subset of topics you're i
....Read More |
Rating
|
|
|
Determine whether an API function is available
|
Total Hit (3453) |
In many cases you may want to call an API function, but you aren't sure whether the Windows version the application is running on supports that particular function.
The easiest way to test whether a function exists and can be called is to replicate through VB code what Windows itself would do whe
....Read More |
Rating
|
|
|
How to configure control licensing
|
Total Hit (2951) |
The .NET Framework has a licensing model identical for all types of components and
controls that is fully compatible with the licensing rules used for ActiveX controls.
Developing and Implementing Windows-Based Applications with Microsoft Visual Basic .NET and Microsoft Visual Studio .NET
Licensi
....Read More |
Rating
|
|
|
Get Mouse Position Anywhere, Anytime
|
Total Hit (3816) |
Some control events provide the mouse pointer's current position within the control's client area; others provide only the screen coordinates of the mouse pointer (the same as returned by Cursor.Position). Is there a function that tells you where the mouse is positioned within a specific control? We
....Read More |
Rating
|
|
|
|
|
How to send/receive XML document using HTTP POST ?
|
Total Hit (10564) |
In my recent project we had a requirement to send a HTTP request in XML document format (e.g. request for a specific order detail). The response was also in XML format. So now question is how would you do that in .Net? Here is the code snippet which you can use to do the same thing.
«code LangId=
....Read More |
Rating
|
|
|
|
|
SearchFileInDirTree - Searches a file on a directory tree
|
Total Hit (2855) |
«Code LangId=2»
<System.Runtime.InteropServices.DllImport("imagehlp.dll")> Shared Function _
SearchTreeForFile(ByVal rootPath As String, ByVal inputPathName As String, _
ByVal outputPathBuffer As System.Text.StringBuilder) As Boolean
End Function
' Returns the complete path+name of th
....Read More |
Rating
|
|
|
|
|
|
|
A For Each statement that visits items in random order
|
Total Hit (2702) |
At times you may need to process elements of an array, a collection, or a dictionary object in random order, for example when sampling a population or (more often) when writing a game, such as a card game. Here's a class that you can use in a For Each statement to randomly process all the elements o
....Read More |
Rating
|
|
|
KeepInRange - Ensure that a value is in a given range
|
Total Hit (2545) |
«Code LangId=2»
' Keep the first argument in the range [lowLimit, highLimit]
' If the value is adjusted, the fourth (optional) argument is set to True
'
' This function works will all basic data types and with objects
' that implement the IComparable interface
Function KeepInRange(ByVal va
....Read More |
Rating
|
|
|
IsValidPath - Validating a system path
|
Total Hit (4587) |
«Code LangId=2»' Validate a system path
' Example:
' MessageBox.Show(IsValidPath("C:\Test\Memo.txt")) ' => True
' MessageBox.Show(IsValidPath("\\RemotePC\Test\Memo.txt")) ' => True
' MessageBox.Show(IsValidPath("C:\Test\Mem|o.txt")) ' => False
Function IsValidPath(ByVal p
....Read More |
Rating
|
|
|
MoveListboxItem - Moving an item of a listbox to another index
|
Total Hit (2555) |
«Code LangId=2»
' Moves an item of a listbox to another index
' If FROMINDEX = -1 then it moves the current highlighted item
'
' Example:
' ' move up the selected item
' MoveListboxItem(ListBox1, -1, ListBox1.SelectedIndex - 1)
' ' move down the selected item
' MoveListboxItem(ListB
....Read More |
Rating
|
|
|
The DataTable's Compute method
|
Total Hit (3058) |
The DataTable class has a method, Compute, that executes SQL-like functions on the rows locally stored in the DataTable. It supports functions such as COUNT, SUM, MIN, MAX, AVG and others. Here's an example to calculate the average salary for the employees stored in the tableEmployees DataTable:
....Read More |
Rating
|
|
|
|
Formatting the Windows Forms DataGrid Control in Visual Basic
|
Total Hit (1027) |
Quite a few basic tasks related to formatting the Windows Forms DataGrid control require you to create and implement your own custom column styles. However, once you are familiar with these objects, you will have a lot of power at your disposal.
|
Rating
|
|
|
ADO.NET: Get Out Parameters from a Stored Procedure
|
Total Hit (550) |
Some stored procedures return values through parameters. When a parameter in a SQL statement or stored procedure is declared as "out", the value of the parameter is returned back to the caller; the value is stored in a parameter in the Parameters collection on the OleDbCommand or SqlCommand objects.
....Read More |
Rating
|
|
|
|
Using Animated Cursors in .NET
|
Total Hit (1821) |
The Cursor class provided with System.Windows.Forms doesn't support animated cursors - but this tiny class lets you use them interchangably with the existing .NET Framework cursors. Also provided with the code is a technique for drawing cursors directly onto forms and animating on a background threa
....Read More |
Rating
|
|
|
How Do I...Load and use the XmlDocument (W3C DOM)?
|
Total Hit (1002) |
How Do I...Load and use the XmlDocument (W3C DOM)?
This sample illustrates the classes which implement:
«LI»the Document Object Model (Core) Level 1 the World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Specification.
«LI»the Document Object Model Core in the W3C Document Ob
....Read More |
Rating
|
|
|
Cancellable In-Place Edit Popups
|
Total Hit (1632) |
Controls like the ListView and the Outlook ListBar allow you to edit items in place by either double-clicking them or through a context UI feature such as a menu. This article provides a class which helps with the tricky parts of implementing in-place editing, and demonstrates how to use it to creat
....Read More |
Rating
|
|
|
How Do I...Create a Publisher Policy Assembly?
|
Total Hit (968) |
A Publisher policy statement describes the compatibility of an assembly issued by the publisher of that shared assembly. See How Do I...Use Version Policy" to see how a publisher's policy statement fits into the overall .NET Framework version policy scheme. Publisher policy is commonly used in servi
....Read More |
Rating
|
|
|
Associations
|
Total Hit (1600) |
Applications such as WinZip add new items to Explorer's File and context menus for all files and folders on the system. Although WinZip uses Shell Extensions to achieve this, it is much easier to do using verbs. This article demonstrates how to use the .NET Registry classes to add new shortcut verbs
....Read More |
Rating
|
|
|
Welcome to Visual Basic .NET
|
Total Hit (2372) |
The goal of this book is to help you come up to speed with the Visual Basic .NET language even if you have never programmed anything before. We will start slowly, and build on what we learn. So take a deep breath, let it out slowly, and tell yourself you can do this. No sweat! No kidding! This secon
....Read More |
Rating
|
|