Bagikan melalui


How to: Add using for Unbound Type

Use this procedure to perform the Add using for Unbound Type IntelliSense operation. For more information, see Add using.

Procedure

To add a using directive to an unbound type

  1. Create a console application. Name the application AddUsing. For more information, see Building Console Applications.

  2. Verify that the existing using directives at the top of the program do not include using System.Data.

  3. Double-click References in Solution Explorer to verify that System.Data is in the list.

  4. Replace the Program class with the following code.

    class ExampleClass
    {
        // For this feature to have an effect, the project must have
        // a reference to System.Data.dll, and must not already have
        // a using directive for System.Data.
    
        // A using directive is required for type DataSet.
        DataSet ds;
    }
    
  5. Right-click DataSet in ExampleClass to display the shortcut menu, point to Resolve, and then click using System.Data.

  6. The following line is added to the using directives at the top of the program: using System.Data;

See Also

Other Resources

Automatic Code Generation