Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No Output (VB.NET)

    Ignorance is not bliss. I'm a VB6 programmer from way back and am trying to build my first app using VB.net.

    I've had to run the app in the command window in order to see my output. Does anyone know why I can't see the output in Visual Studio? The application builds in VS just fine, but when I try to execute it (Debug>>Start without debugging) all I see is the build info in the Output windows.

    Now I've added database connectivity and I get errors in the build:

    error BC30466: Namespace or type 'SqlClient' for the Imports 'System.Data.SqlClient' cannot be found.

    I get a similar error everyplace I use one of the SQL objects:

    error BC30002: Type 'SqlCommand' is not defined.

    In order to get my app to run in the Command window, I had to add directories to my path, lib and include environment strings. I guess that I need to add the SQL directories to one or more of these but I don't know what I need to add and I haven't been able to find it on the web.

    Any help would be appreciated. I've spent a couple of hours I don't have on this problem and am stuck until I can see my output.

    Thanks in advance,

    Mary

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No Output (VB.NET)

    .NET is really funny about references to certain "class libraries" (.NET Namespaces)

    You'll need to be sure the proper namespaces are added as References to your project. You can probably solve your Sql issue easily by making sure the System.Data namespace is added as a reference. You may also consider adding "Imports System.Data" and/Or "Imports System.Data.SqlClient" at the top of each module in order to save typing within that module.

    In order to get your output to write to the Output window, use System.Diagnostics.Debug.Write (or WriteLine). The only catch is that you have to be sure your application is running in Debug mode (as opposed to Release). All Debug-related code is ignored when compiling/running in Realease mode.

    These initial issues are somewhat frustrating to overcome; but once you figure it out, I'm sure you'll LOVE .NET!!

    Please feel free to post back if you have any further questions...

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No Output (VB.NET)

    I often debug by adding a ListBox control and then, instead of writing to the console or Output window, I add each line to the list, which you can then easily scroll before closing the Form.

  4. #4
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No Output (VB.NET)

    Thanks Mark! I was not using the Debug run command and, thus, no output. I've been able to make good progress once I could see what was going on.

    I did have the imports statement in the module that uses it. I still think I need some additions to my environment variables in able to make the app run using the cmd window but I sure haven't a clue what they are. At least I'm able to go forward. This app won't actually have much, if any, screen output. It's a data mining app that builds tables in a database.

    I really think I'm going to like .NET. It's just that the learning curve is really steep. I could have written this same code in VB6 in a day and it's been over a week and I'm still plugging away. It's really slow when you have to look up everything you want to do. Luckily I had OOP C++ several years back and I was able to take a series of .NET classes at our local community college. Really helps to give one a good start.

    I have a large VB6 and ASP app that has to be completely rewritten because we're going to make major changes. It's going to be written in .NET so that I only have to write the business logic once and have the two different front ends. It may end up that everything runs off the web and then I'll only need one front end. Not quite there yet, still figuring out exactly what the product is.

    Thanks again,

    Mary

  5. #5
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No Output (VB.NET)

    Thanks Howard. I'll use your suggestion at some point to post results of the file reads.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •