protected void btnRead_Click1(object sender, EventArgs e) { da = new SqlDataAdapter("select Top(1)blogpath from images order by id desc", con); //da = new SqlDataAdapter("select Id, blogpath from images where Id=(select Max(Id) from images)", con); ds = new DataSet(); da.Fill(ds); Lit.Text = ds.Tables[0].Rows[0]["BlogPath"].ToString(); Lit.DataBind(); string name = ds.Tables[0].Rows[0]["BlogPath"].ToString(); string filePath = blgFile.PostedFile.FileName; if (System.IO.File.Exists(Server.MapPath("~/TextFiles/Blogs/") + name)) { string fileName = Server.MapPath("~/TextFiles/Blogs/") + name; String contents = File.ReadAllText(fileName); ds = new DataSet(); da.Fill(ds); rptrBlg.DataSource = ds; rptrBlg.DataBind(); Lit1.Text = contents.ToString(); } } } This is on Blog.ascx page- <div> <asp:Repeater ID="rptrBlg" runat="server"> <HeaderTemplate> <table border="0" width="600px" cellpadding="2" cellspacing="1" style="border: 1px solid maroon;"> <tr bgcolor="pink"> <th>Blog</th> </tr> </HeaderTemplate> <itemtemplate> <table><tbody><tr><td> <%# DataBinder.Eval(Container.DataItem,"BlogPath") %> <asp:Literal ID="Lit1" runat="server"> </td></tr></tbody></table> </itemtemplate> </table></div> Thanks in Advance Akhilesh Pathak
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)