dataset ds=new dataset();
system.data.sqlclient.sqlconnection cnn=new system.data.sqlclient.sqlconnection("server=(local);database=northwind;trusted_connection=yes") ;
cnn.open();
system.data.sqlclient.sqlcommand cmd=new system.data.sqlclient.sqlcommand();
cmd.connection=cnn;
cmd.commandtext="select * from persondetails where 1<>1" ;
system.data.sqlclient.sqldatareader dr=cmd.executereader(system.data.commandbehavior.closeconnection) ;
this.datagrid1.datasource=dr.getschematable();
cnn.close();
dr.close();