View Single Post
Old May 25th, 2007, 07:07 AM
pavank pavank is offline
Registered User
Join Date: May 2007
Location: guntur, ap, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pavank

Take one function like

private void fillgrid()
     here take sqlconnection

   and using sqldataadapter or sqlcommand select query for filling in girdview

    sqldataadapter sqlda=new sqldataadapter(sqlquery,con);
     sqlcommand sqlcmd=new sqlcommand(sqlquery,con);

   for sqldataadapter take dataset

  as dataset ds=new dataset();

    and fill sqldataadapter with dataset for getting data like


 and write

 gridview1.datasource=ds; // gridview1 is id of gridview.


you call this function in page_load...



use this one .....

gud luck