SqlConnection thisConnection=new SqlConnection
("Data Source=(local);Initial Catalog=Northwind;UID=sa;PWD=");
try
{
thisConnection.Open ();
}
catch(Exception ex)
{
thisConnection.Close ();
}
string sql1="select * from employees";
string sql2="select * from Customers";
SqlDataAdapter sda=new SqlDataAdapter(sql1,thisConnection);
DataSet ds= new DataSet();
sda.Fill(ds,"myemployees");
sda.Dispose();
SqlDataAdapter sda1=new SqlDataAdapter(sql2,thisConnection);
sda1.Fill(ds,"myCustomers");
sda1.Dispose();
string t1=ds.Tables["myemployees"].Rows[0]["Hiredate"].ToString();
string t2=ds.Tables["myCustomers"].Rows[0]["ContactTitle"].ToString();
Page.RegisterStartupScript("aa","<script language=javascript>alert('t1="+t1+",t2="+t2+"');</script>");