Image representing the Snippets category

How Do I Bind a Database to a WebFX Combo Box Control?

Published 19 years ago

An often requested feature in Web applications is a drop-down that behaves like a Combo Box in Windows applications. If you start typing in a drop-down in a Windows application, it will preselect an item that starts with all the letters you type in. The drop-down in a Web browser preselects the item that starts with the last letter you typed in. Not very convenient. Fortunately, there are many replacements for the default drop-down available. One of them is the WebFX Combobox. In this snippet, I will demonstrate you how to fill this control with information from a database. I won't be discussing how the control works, and I also won't explain how you can use the advanced features of the control that allows you to add new data. This snippet will simply demonstrate how to generate the client-side code for the drop-down with information from a database.

Read on ...
Image representing the Snippets category

Find Out Whether a Specific Column Exists in a Database Table

Published 20 years ago

This snippet will allow you to check whether a certain column exists in a database table or not. Useful when you're coding against a database which schema you don't fully know. Just change the name of the column you're looking for (nameToCheck), the Connection String and the SQL SELECT statement, the bold items in this snippet.

Read on ...
Image representing the Snippets category

Display Information About a Microsoft Access Database

Published 20 years ago

The following block of code will display the properties of ALL tables in a Microsoft Access database. For the code to run successfully, the variable MyConnectionString needs to contain a valid connection string pointing to the Access database.
With this code, all tables, including system tables are displayed. If you want to limit the list, use myTable.Type to determine the type of the table and skip the system tables. User tables will return "TABLE", while system tables will return "ACCESS TABLE".

If you want to display information about just a single table, remove the For Each loop and uncomment the line that starts with Set myTable. Don't forget the pass the name of the right table to the Tables collection.

Read on ...
Image representing the Snippets category

Execute a Stored Procedure Without an Explicit ADO Command Object

Published 20 years ago

The following code shows you how to execute a Stored Procedure (called MyStoredProcedure) in ASP without creating an explicit ADO Command object. The Stored Procedure expects two parameters: @FirstParam (of datatype int) and @SecondParam (of datatype varchar). Modify the parameter list to suit your requirements

Read on ...
Image representing the Snippets category

How Do I Check If a Number Is Even Or Odd in ASP?

Published 20 years ago

Use this snippet to check whether a given number (passed in as numberToCheck is even or odd.

Read on ...
Image representing the Snippets category

Preventing a Page from Being Cached by Browsers and Proxy Servers

Published 20 years ago

Add the following code to the top of your ASP page to prevent it from being cached by the browser or any intermediate proxy or caching server. This will force the browser to retrieve a new copy of the page, everytime it needs to display it.

Read on ...
  • «First
  • Previous
  • 1
  • Next
  • »Last

Mobile: False

Crawler: True

I: False