This is a discussion on What is the difference between "using System.Data;" and directly adding the refer within the ASP and ASP.NET Programming forums, part of the Web Development category; What is the difference between "using System.Data;" and directly adding the reference from "Add References Dialog ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| What is the difference between "using System.Data;" and directly adding the reference from "Add References Dialog Box"? Thx Kirthika |
| Sponsored Links |
| |||
| hi, When u compile a program using command line, u add the references using /r switch. When you compile a program using Visual Studio, it adds those references to our assembly, which are added using "Add Reference" dialog box. While "using" statement facilitates us to use classes without using their fully qualified names. For example: if u have added a reference to "System.Data.SqlClient" using "Add Reference" dialog box then u can use SqlConnection class like this: System.Data.SqlClient.SqlConnection But if u add a "using System.Data.SqlClient" statement at the start of ur code then u can directly use SqlConnection class. On the other hand if u add a reference using "using System.Data.SqlClient" statement, but don't add it using "Add Reference" dialog box, Visual Studio will give error message while we compile the program.
__________________ Venkat knowledge is Power |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1. What is the difference between "calloc(...)" and "malloc(...)"? | oxygen | C and C++ Programming | 1 | 07-30-2007 08:13 AM |
| I keep getting "Data Missing" when I click the "back" button in my browser. How can I | oxygen | HTML, CSS and Javascript Coding Techniques | 1 | 07-28-2007 01:12 AM |
| What is the difference between "using System.Data;" and directly adding the reference | H2o | ASP and ASP.NET Programming | 1 | 07-24-2007 03:33 AM |
| Difference between "printf" and "sprintf". | Sabari | C and C++ Programming | 1 | 07-23-2007 06:23 AM |
| Difference between a "assignment operator" and a "copy constructor"? | vigneshgets | C and C++ Programming | 2 | 07-12-2007 05:30 AM |