Skip Navigation LinksHome > Categories > Code from a Category

Diffferences between Add References and Imports



User Name: jamest85
Name: James T
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
4 years experience on Zoho consulting, implementation, and programming using C#, VB, Php..., 9 years of total IT experience including programming and application development. 5 years of Experienced an... [More]
Viewed Times: 215
Add Date: 08/24/2010
This post tells the main differences between Add References and Imports
In VB.Net (for example), we need add : System.configuration assembly to References folder so we can get the ConnectionStrings value from app.config. Below is showing where the System.configuration located.


The code will look like this: To get sConn value, you need type fully qualifited names which is quite long, however, if you add "Imports System.Configuration" at the top of the code, it will be better Note: If we don't add References, and only use: Imports in the code, it won't work.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.