Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6653859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:19:15+00:00 2026-05-26T01:19:15+00:00

I am using asp.net 2008 repeater control. I am trying to refresh the repeater

  • 0

I am using asp.net 2008 repeater control. I am trying to refresh the repeater control when a button is clicked, it shows me duplicated values, that means its appending the same values once again. Here is my code

 public void LoadRepeater1()
    {
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlServerConnection"].ConnectionString);
        String sql;
        sql = "select * from FeeCollection Where AdminNo='"+lblstano.Text+"'";
        cmd = new SqlCommand(sql, con);
        da = new SqlDataAdapter(sql, con);
        da.Fill(ds, "FeeCollection");
        dt = ds.Tables["FeeCollection"];

        Repeater4.DataSource = dt;
        Repeater4.DataBind();
        con.Close();


    }

 protected void btnMedical_Click(object sender, EventArgs e)
    {
        LoadRepeater1();
    }

I want to remove the existing data and refresh the data instead of appending.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:19:15+00:00Added an answer on May 26, 2026 at 1:19 am

    Not sure where ds (DataSet) in instantiated. Try to instantiate the DataSet/DataTable within the LoadRepeater1() method.

    public void LoadRepeater1()
        {
            con = new SqlConnection(ConfigurationManager
             .ConnectionStrings["SqlServerConnection"].ConnectionString);
    
            sql = "select * from FeeCollection Where AdminNo=@AdminNo";
            cmd = new SqlCommand(sql, con);
            cmd.Parameters.Add("@AdminNo",System.Data.SqlDbType.VarChar,20).Value=lblstano.Text;
            da = new SqlDataAdapter(cmd);
            DataTable dt=new DataTable();
            da.Fill(dt);
            Repeater4.DataSource = dt;
            Repeater4.DataBind();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the ListView control (ASP.NET 2008) to show a bunch of lines of
I am using the ASP.NET GeneratedImage control (http://weblogs.asp.net/craigshoemaker/archive/2008/08/19/new-asp-net-generated-image-control.aspx) The image handler seems to receive
i am using asp.net with c# web app in vs 2008 problem 1: i
I am using ASP.Net + .Net 3.5 + VSTS 2008 + IIS 7.0 +
I am using ASP.Net + .Net 3.5 + VSTS 2008 + IIS 7.0 +
I am using ASP.NET MVC 2 & .Net 3.5 with Visual Studio 2008. Ok,
I am working on a CMS project using ASP.Net 3.5/Visual studio 2008.This is the
I'm having a problem with JQGrid using ASP.NET MVC. I'm trying to follow this
using asp.net, sql server 2008, winserver2003 we have about 10 tables with about 20
Using asp.net, c# 3.5, vs 2008. I have an aspx gridview called gv1 with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.