TeamInfoCenter

 
Home Products Collaborative Apps Examples and Ideas About Us Feedback

Q. How to create a Data Table that has all the unique values for a column in a database

Generate a new data adapter

  1.  In the toolbox, from the Data tab add a new Data Adapter. When the Data Adapter configuration wizard appears, click Next.
  2. Select the connection to your database that you are working with and click Next.
  3. Select Use SQL Statements and click Next.
  4. Enter the following SQL statement: SELECT DISTINCT myColumn FROM myTable
  5. Click the Advanced Options button on the dialog
  6. Clear the options for Generate Insert, Update and Delete statements. These statements are not needed for a dataset used for the population of unique items.
  7. Click Finish to generate the Data Adapter

Next Generate a new Dataset

  1. On the new data adapter property box, select Generate Data Set
  2. Click on New and enter the name for your dataset such as dsMyData
  3. Make sure that you select the Add This Dataset to the Designer option and click OK. Now the dataset will generated.

© Copyright 2003-2007 JWG Solutions, All Rights Reserved.