????ASP.NET??using???÷?1.using??using + ???????????????????????????????????????е????????????????????????????????????Java??import????????????????????????cs????????????

???????磺using System;

????using System.Data;

????ASP.NET??using???÷?2.using????????????Χ?????Χ????????????

??????????

???????????????????????????????????????????????????????????????????????????????Dispose??

???????????????????try...catch???????????????????using??????

???????磺

public static DataTable GetTable(string sql?? int executeTimeOut?? string connStringName)
{
????DataTable dtRet = new DataTable();
????using (SqlConnection sc = new SqlConnection(connStringName))
????{
????????using (SqlDataAdapter sqa = new SqlDataAdapter(sql?? sc))
????????{
????????????sqa.SelectCommand.CommandTimeout = executeTimeOut;
????????????sqa.Fill(dtRet);
????????????return dtRet;
????????}
????}
}
 


????ASP.NET??using???÷?3.using??????using + ???? = ????????????????????????????

?????????????и???????????cs??????????????????????????????????????????????????????????????????????????????????????????????????????????????Щ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????using????????????

???????磺
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using aClass = ConsoleApplication1.MyClass;
using bClass = ConsoleApplication2.MyClass;
namespace ConsoleApplication1
{
????public class MyClass
????{
????????public override string ToString()
????????{
????????????return "You are in ConsoleApplication1.MyClass";
????????}
????}
????class TestUsing
????{
????}
}

namespace ConsoleApplication2
{
????class MyClass
????{
????????public override string ToString()
????????{
????????????return "You are in ConsoleApplication2.MyClass";
????????}
????}
}

namespace TestUsing
{
????using ConsoleApplication1;
????using ConsoleApplication2;
????class ClassTestUsing
????{
????????static void Main()
????????{
????????????aClass my1 = new aClass();
????????????Console.WriteLine(my1);
????????????bClass my2 = new bClass();
????????????Console.WriteLine(my2);
????????????Console.WriteLine("ress any key");
????????????Console.Read();
????????}
????}
}