Creating a DataTable

Posted on 2005-05-13
Last Modified: 2010-04-16

I am creating a console app in VS.NET and my using statements are:

using System;
using System.Data;
using System.Data.SqlClient;

However when i write "DataTable dt = new" and click space, Visual Studio does not bring up DataTable automatically. After that on the next line when i use "dt." nothing appears after the dot.

Am i missing some other using statement?

Question by:Kokas79
    LVL 1

    Assisted Solution

    re install visual and
    try to write

    DataTable dt = new DataTable
    you can use dt object

    Author Comment

    well it works fine with other things like DataAdapter....i will try to see on my other machine. But i want to avoid re-installing!
    LVL 3

    Expert Comment

    Does it compile or is it just intellisense that fails?
    If it doesn't compile, did you try removing the 'using' statement and declaring it as 'System.Data.DataTable' instead?
    LVL 1

    Assisted Solution

    does the project compile without that line?

    if you have a syntax error above the line in question, intellisense will act up.
    LVL 3

    Accepted Solution

    The error doesn't necessarily have to be above. Any error that prevents the CLR from parsing the file can potentially cause intellisense to stop working. That's why I was asking.

    What I'd suggest is write it anyway and check the task list. If that is the only error, you should start to worry.
    If it is not, check all other errors first.

    Author Comment

    damn thing works now...all i did was removed the project and added a new one...!

    sorry guys for wasting your time...i will give extra points

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now