MTSkull Posted June 10, 2003 Posted June 10, 2003 I am having a bit of a problem and I do not know if it is my inexperiance with .net or something else. I have a project reference to system.data if I type in a form in the project "Dim dsProducts As New DataSet" I get an error that it can not find DATASET but if I type... "Dim dsProducts As New System.Data.DataSet" It is happy with this. How do I expose the refernces so I do not have to type the full reference name like several examples I have. This is true for all references no matter what they point to. (ie messagebox()) Thanks Brian:confused: Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
aewarnick Posted June 10, 2003 Posted June 10, 2003 At the top of your source file you should see something like using System; (using is C# syntax not VB) Just put using System.Data; with the rest of them. Except VB syntax instead. Quote C#
MTSkull Posted June 10, 2003 Author Posted June 10, 2003 Thanks... So just to clarify. Even if I set a refrence in the solution explorer that means mothing to the rest of the project, I still have to put "Imports System.Data" at the head of every code module? If this is true why did they bother with the refrencing in the Solution Explorer... Stupid Microsoft:mad: Thanks Again Brian Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
*Experts* mutant Posted June 10, 2003 *Experts* Posted June 10, 2003 If you didnt reference in the solution explorer you wont be able to use the Data namespace at all, because there you add the actual file that contains the namespace to your project. In imports System.Data You only make a shortcut to the classes in the namespace. Quote
AndreRyan Posted June 11, 2003 Posted June 11, 2003 If everything was chucked into one list without the Imports statement, you would spend AGES searching through every class of the 1000+ of the .Net Framework whilst looking for a particular function when you could just System.Data and know eveything there has something to do with databases. References are like in VB6 and C++, etc. You must #Include "MyHeader.h" or Project>References to add a connection to a DLL Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
*Gurus* divil Posted June 11, 2003 *Gurus* Posted June 11, 2003 ...Stupid Microsoft MTSkull, Making a reference to an external assembly and creating a shortcut so you don't have to fully-qualify class names are two very different things. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
MTSkull Posted June 11, 2003 Author Posted June 11, 2003 This is simply a case of my inexperience with .net. Like VB6 I had assumed that if something was reflected in the references that I could use it anywhere. With Andres explanation as to the why's I see the logic behind this mechanism. You can never convince me that MS is not stupid in some ways. For every piece of brilliance they produce there is a corresponding thing that makes you scratch your head and go "What the heck where they thinking" and I can cite numerous examples. I do not hate MS and I suppose there is a reason behind everything they do. After all Bill did something right, he is the one with all the cash. :rolleyes: Brian PS one thing I really LIKE about .net is having this site open on one of the programming tabs :) Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.