i have twritten this code , but i am getting a exception when i try to debug my code ..
public partial class Article : System.Web.UI.Page { SqlConnection con; SqlDataAdapter da1, da2; DataSet ds=new DataSet(); LoginView lv; public static string articleid; string str=ConfigurationManager.ConnectionStrings["connect"].ConnectionString; protected void Page_Load(object sender, EventArgs e) { articleid=Request.QueryString["ArticleID"]; lv =(LoginView) Master.FindControl("HeadLoginView"); if (!lv.Page.User.Identity.IsAuthenticated) { pnlComments.Visible = false; hplreq.Visible = true; } else { pnlComments.Visible = true; hplreq.Visible = false; } // displaying selected article con = new SqlConnection(str); con.Open(); da1 = new SqlDataAdapter("select * from Articles where ArticleID = "+ articleid,con); ds.Clear();da1.Fill(ds,"Article"); imgArticle.ImageUrl = ds.Tables["Article"].Rows[0]["ImageUrl"].ToString(); lblBody.Text = ds.Tables["Article"].Rows[0]["Body"].ToString(); lblTitle.Text = ds.Tables["Article"].Rows[0]["Title"].ToString(); lblAddedBy.Text = ds.Tables["Article"].Rows[0]["AddedBy"].ToString(); lblAddedDate.Text = ds.Tables["Article"].Rows[0]["AddedDate"].ToString(); // displaying others articles da2 = new SqlDataAdapter("seletc 8 from Articles where NOT ArticleID = "+articleid,con); ds.Clear(); da2.Fill(ds,"Articles"); lstArticle.DataSource = ds; lstArticle.DataBind(); HyperLink hplread=(HyperLink) lstArticle.FindControl("HyperLink1"); hplread.NavigateUrl = "~/Account/Login.aspx?ReturnUrl=~/Article.aspx?ArticleID="+articleid; con.Close(); }
i have bold the line where i am getting the exception . what is wrong in this code . please help me