this is basically a tutorial question to ask since am a beginner I would like to what is a difference between the using statement we use at start of our C# code to include assembly and namespaces
like this:
using System.Web.Services; and when we write inside the code within the method or code. like this:
using (SqlDataAdapter adapter = new SqlDataAdapter(cmd)) is there any difference or they both are same, any guidance would be helpful and appreciated.
usingdirective allowing you to access types defined in a specific namespace without using the fully qualified names. The second is theusingstatement allowing you to dispose disposable objects easily.using namespaceis a "using directive" rather than a statement. This makes a difference when you move from being a beginner and are interested in the precise definition (eg. in the language specification).