ALL >> Technology,-Gadget-and-Science >> View Article
Dbcombo
If you have ever tried loading a large number of records into a drop down box you know that this can significantly slow down the page. A great solution is DbCombo (www.dbcombo.com). DbCombo is a managed ASP.Net control that uses a datasource to auto complete and display matching results in a drop-down box without using a page postback.
The data is provided from the datasource dynamically so you can virtually have an unlimited number of results returned. This is all done without sacrificing the speed of your application. Can you imagine loading 100,000 records into a standard box? It is virtually impossible but DbCombo can easily handle this and it's literally done in a matter of seconds.
If you have visitors that use your site with older browsers there is no need to be concerned about compatibility. DbCombo gracefully degrades to HTML 3.2 on older browsers without losing any functionality. In the degraded state a postback is necessary but it all happens dynamically without having to write additional code.
For the advanced developer DbCombo contains over 40 properties. There are also numerous ...
... JavaScript functions that allow you to interact with DbCombo on your page and do things like easily get the selected text or reset the control. These properties and functions allow the component to be easily customized for a variety of needs.
DbCombo is easy enough to use that even casual developers can incorporate it into their site and it only takes a small amount of code to get it working. Here's a simple example of how to include this powerful control in your page.
First you need to create a file called DbComboServer.aspx and place it in the root of your site or application. This file is needed in order for DbCombo to work properly and is in addition to the page(s) that you are going to actually use DbCombo on. Delete anything from the file that might have been automatically generated from your editor and replace it with the following:
Important: The above line is the only thing that should be in that file. If your editor created a code behind page for DbComboServer.aspx you can also delete that. It isn't used or needed.
Next you need to ensure that DbCombo will work on the production server. Add the following inside the tag of your web.config and replace REGISTRATION KEY with the one you were provided. If you are testing locally on your development machine you can leave this as is or leave the registration key blank.
If you happen to have a hosting provider that provides the license key already, you don't need to add this to web.config. ORCS Web (www.orcsweb.com) provides dbcombo at no charge for all shared hosting accounts so it isn't necessary to add this to your web.config. The component along with the .xml file also needs to be uploaded to the /bin folder of the site. If your site is hosted with a hosting company they can place these files into your /bin folder for you.
At the top of the page where you are going to use DbCombo, you need to add the following lines:
Add the following between the tags of the page to add a Server Method. Make sure you change the connection string and query to reflect your settings as indicated in the comments below.
_
Public Shared Function DbComboMethod(ByVal args As Cambro.Web.DbCombo.ServerMethodArgs) As Object
Dim dsDbCombo As DataSet = New DataSet
'Update the below with your connection string:
Dim conn As SqlConnection = _
New SqlConnection("server=localhost;uid=username;pwd=password;database=databasename")
Dim adapter As SqlDataAdapter = New SqlDataAdapter
'Update the below with your SQL Statement
'name is the column from where you are getting the records
'comboID is the primary key needed to reference the selected value
'dbcombo is the name of the table
adapter.SelectCommand = New SqlCommand("SELECT TOP " & args.Top.ToString() & " name AS DbComboText, comboID AS DbComboValue FROM dbcombo ORDER BY name", conn)
adapter.Fill(dsDbCombo)
conn.Close()
Return dsDbCombo
End Function Protected Sub DbComboOnInit(ByVal sender As Object, ByVal e As EventArgs)
Dim ComboBox As DbCombo = CType(sender, DbCombo)
'Get the registration key from the configuration file ComboBox.RegistrationKey = System.Configuration.ConfigurationSettings.AppSettings("DBComboKey")
'The following are some of the options you can set for DbCombo
ComboBox.ShowDbComboLink = False
ComboBox.SelectSingleItemOnTab = True
ComboBox.SelectSingleItemOnEnter = True
ComboBox.TabToNextFieldOnEnter = True
ComboBox.Debug = False
End Sub
Add the following to place an instance of DbCombo wherever you desire on the page: Note: Since this is an ASP.Net component it needs to be inside of a tag.
You now have a functioning DbCombo control on your page. You should install the latest version on your development machine to test with before uploading it to a live production server. You can get the latest here: http://www.dbcombo.com/download.aspx. The download includes over 15 various demos and tutorials along with a comprehensive help file and a user manual. The manual is thorough and includes code samples in VB.Net and C# to get you up to speed quickly.
Rick Barber is a support specialist with ORCS Web, Inc. - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.
About the Author
Rick Barber is a support specialist with ORCS Web, Inc. - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.
Add Comment
Technology, Gadget and Science Articles
1. The Economics Of Final-stage Package Delivery: A Comprehensive Market OverviewAuthor: Shreya
2. Growth Outlook Of The South Korea Cytogenetics Market: Clinical Applications And Technological Innovations
Author: Shreya
3. U.s. Water And Wastewater Treatment Technologies Market 2025–2035: Growth Trends And Future Opportunities
Author: Shreya
4. Instashop Egypt Real-time Api - Sku-level Stock & Availability Mapping
Author: Actowiz Solutions
5. Web Scraping Canadian Grocery Retailer Pricing Data
Author: REAL DATA API
6. Why Erp Is Critical For Manufacturing Innovation
Author: Focus Softnet
7. Umbraco Vs Wordpress: Choosing The Right Cms For Your Business
Author: Addact Technologies
8. How Web Development Enables Seamless Integration With Third-party Tools And Apis
Author: jessika
9. E-commerce Growth By Jumia Data Scraping For Market Research
Author: Web Data Crawler
10. Web Scraping Api For Minibar Delivery Liquor Data In Usa
Author: Food Data Scraper
11. Web Scraping Hulu Ratings And Engagement Data
Author: REAL DATA API
12. Christmas Liquor Demand Data Scraper
Author: Actowiz Solutions
13. Best Buy Product Price & Item Data Scraping Guide
Author: Retail Scrape
14. Top 100 Christmas Gifts 2025 Data Analytics
Author: Actowiz Metrics
15. Scrape Ezpawn Store Locations To Map Pawn Industry Trends
Author: REAL DATA API






