|
Running an Insert SQL Query with ADO.NET and VB.NET
|
Total Hit (1609) |
If you have SQL server setup on your machine and the Northwind database then this example should work for you. You may have to change the password for the sa account as it's blank in the example.
|
Rating
|
|
|
|
|
|
|
Linking a file in Visual Studio .NET
|
Total Hit (2644) |
If in VS.NET you add to the current project an existing file that's located outside the current project's directory, the file is first copied in the project's directory, and then it's added to the project. However, you may want to share the same source file among multiple projects, so that if you mo
....Read More |
Rating
|
|
|
Shortcuts to useful VS.NET's commands
|
Total Hit (2628) |
Visual Studio .NET has a number of useful features that are often underused by developers, because they are hidden under several menus and not easily accessible. Here is a list of keyboard shortcuts to some of these commands:
Ctrl + - : moves the caret to its previous position.
Ctrl + Shift +
....Read More |
Rating
|
|
|
|
|
Age - Evaluating the age of a person, given his/her birth date
|
Total Hit (2086) |
«Code LangId=2»' Evaluate the age of a person, given his/her birth date
' Example: Debug.WriteLine(Age(#9/28/1980#)) ' => 22
Function Age(ByVal birthDate As Date, Optional ByVal currentDate As Date = #1/1/ _
1900#, Optional ByVal exactAge As Boolean = True) As Integer
If currentDate
....Read More |
Rating
|
|
|
Hex - Convert from decimal to hexadecimal
|
Total Hit (3873) |
«Code LangId=2»' convert from decimal to hexadecimal
' if you pass the Digits argument, the result is truncated to that number of
' digits
'
' you should always specify Digits if passing negative values
Function Hex(ByVal value As Long, Optional ByVal digits As Short = -1) As String
' c
....Read More |
Rating
|
|
|
|
Drag and Drop files/folders from explorer and display in listbox
|
Total Hit (4131) |
This code will show you how simple it is to get file/folder list dragged from explorer.
«b»Step-By-Step Example«/b»
- Create a Windows Application
- Add one ListBox control on the form
- Add the following code in form1
- Run the project and try to drag and drop some files into listbox from
....Read More |
Rating
|
|
|
Understanding VS.NET public and private assemblies
|
Total Hit (2843) |
As you might have noticed, the Add Reference dialog in Visual Studio displays all the assemblies in the GAC, which brings up the following question: is there a way to have this list display assemblies that aren't in the GAC? The answer is yes, and the technique couldn't be easier.
Use the REGEDIT
....Read More |
Rating
|
|
|
|
|
Calculated columns that refer to relationships
|
Total Hit (2909) |
The DataSet is a container of multiple DataTables, and it allows to create parent-child relationships between two tables, as shown below:
«Code LangId=2»
' create a relationship between the Categories and the Products tables,
' against the CatID column
ds.Relations.Add(New DataRelation("CatPr
....Read More |
Rating
|
|
|
Store large Boolean arrays in a BitArray object
|
Total Hit (5851) |
.NET Boolean values require 4 bytes each, as opposed to the 2 byte taken under previous VB versions. When creating very large Boolean arrays this extra memory impacts negatively on the application's performance. The .NET Framework offers a specialized class, the System.Collection.BitArray class, whi
....Read More |
Rating
|
|
|
ADO.NET: Work with Relational Data
|
Total Hit (579) |
A DataSet can contain either unrelated tables or related tables. You can think of a DataSet as a document of data. In fact, an XML data document is like this, except it is based on a hierarchical paradigm. Because data is often stored in relational databases, the DataSet can handle both hierarchical
....Read More |
Rating
|
|
|
User Tips: Converting URLs into Hyperlinks
|
Total Hit (2013) |
I just finished reading Designing Active Server Pages and was inspired by the regular expressions section. I would like to contribute some code... two functions which are fresh out of the oven!
These functions are to cater for web content stored in a database where URLs & email address are part
....Read More |
Rating
|
|
|
|
How Do I...Sink Unmanaged Events from .NET?
|
Total Hit (877) |
This example demonstrates how to sink unmanaged events from .NET code.
In order to use the types defined within a COM library from managed code, you have to obtain an assembly containing definitions of the COM types. Refer to the How Do I...Build a .NET Client That Uses a COM Server? for specific
....Read More |
Rating
|
|
|
XPath Tester
|
Total Hit (556) |
Using this page you can test your XPath Queries
|
Rating
|
|
|
|
How Do I...Instrument a small application with tracing?
|
Total Hit (900) |
Trace instrumentation enables developers and administrators to monitor applications running in real-life settings (as opposed to running in a debugger). Sometimes using a debugger can hide bugs and obscure some performance and threading problems. Tracing is a very important monitoring and debugging
....Read More |
Rating
|
|
|
Auto-File and URL Completion for Text Boxes and Combo Boxes
|
Total Hit (1608) |
Version 5 of the Shell, shipped with Windows 2000 and ME or above, provides the ability to add Auto-Complete to any Text Box. This sample provides two simple extensions to the TextBox and ComboBox classes to add AutoComplete to your application.
|
Rating
|
|
|
How Do I...Monitor an event log?
|
Total Hit (2306) |
Event logging provides a standard, centralized way for you to have your applications record important software and hardware events. Windows supplies a standard user interface for viewing the logs (Event Log). Using the common language runtime's EventLog component, you can easily connect to existing
....Read More |
Rating
|
|
|
How Do I...Create an assembly with a strong name?
|
Total Hit (971) |
Assemblies can be assigned a cryptographic signature, called a strong name, which provides name uniqueness for the assembly and prevents someone from taking over the name of your assembly (name spoofing). If you are deploying an assembly that will be shared among many applications on the same machin
....Read More |
Rating
|
|
|
Leverage Regular Expressions
|
Total Hit (1984) |
Regular expressions provide a simple and efficient way—far beyond the capabilities most conventional programming languages offer—to search and replace text. However, relatively few developers are familiar with this powerful tool. I'll explain how you can leverage regular expressions from VB.NET to s
....Read More |
Rating
|
|
|
How Do I...Encrypt and Decrypt a file?
|
Total Hit (2725) |
The CryptoStream class in the System.Security.Cryptography namespace is used to easily define cryptographic transforms on any data stream. The constructor is defined as the following: CryptoStream (Stream argument, ICryptoTransform transform, CryptoStreamMode mode).
....Read More |
Rating
|
|