Thursday, March 6, 2008

Before Using that Import Coding to word,Excel,Notepad Use this also

con.ConnectionString = ConfigurationManager.ConnectionStrings["sqlcon"].ConnectionString;
SqlCommand cmd = new SqlCommand("select * from sample", con);
SqlDataAdapter dr = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
dr.Fill(ds, "sample");
datagrid.DataSource = ds;
datagrid.DataBind();
Cache.Insert("sample", ds);

No comments: