that can be datareader or dataset depends upon your requirement.
like this
--DataReader------------------
SqlDataReader myReader = CommandName.ExecuteReader(CommandBehavior.Sequenti alAccess);
while (myReader.Read())
{
Response.write(myReader["Columnanme"].toString());
}
myReader.Close()
---Dataset----
Dataset ds=new Dataset();
SqlDataAdapter cmd1 = new SqlDataAdapter("select * from stock",connection object);
cmd1.Fill(ds,"stock");
now your dataset is filled with records.You can just bind to any controls.
Thanks
Nash
|