DataSet using a repeater?

Im having trouble with displaying the information with repeater, this is done with 2 projects, company and supplier. i used web service to get the information from supplier to company.

Error: the name 'dae does not exist in the current context' (.cs page at the company side)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PawsPawsMock.BLL;
using System.Data;
using System.Data.SqlClient;

namespace PawsPawsMock
{
    public partial class AdminECatalog : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindEventRepeater();
            }
        }
        private void BindEventRepeater()
        {
            BllCompEventCatalog eve = new BllCompEventCatalog();
            DataSet ds = new DataSet(); 
                DataTable dte = new DataTable();
                dae.Fill(dte);
                rptrEvents.DataSource = dte;
                rptrEvents.DataBind();
        }
    }
}

Open in new window

the aspx page(source):
 <asp:Repeater ID="rptrEvents" runat="server">
            <ItemTemplate>
                <div class="col-sm-3 col-md-3">
                    <div class="thumbnail">
                        <!--Add image here--->
                        <div class="caption">
                             <div class="proName"><%#Eval("EName") %></div>
                            <div class="proPrice"><span class="proOgPrice"><%#Eval("EPrice") %></span> <%#Eval("ESelName") %><span class="proPriceDiscount">(201 Off)</span></div>
                        </div>
                    </div>
                </div>
            </ItemTemplate>
        </asp:Repeater>

Open in new window

JayAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
Just as the error indicates, you have not defined what dae is in your code. Best guess is it should be a data adapter.
0
Dirk StraussSenior Full Stack DeveloperCommented:
Your code should look something like this:

private void BindEventRepeater()
{
    string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
    using (SqlConnection con = new SqlConnection(constr))
    {
        using (SqlCommand cmd = new SqlCommand("SELECT * FROM EventsTable", con)) // SELECT is Pseudo, replace with actual query
        {
            using (SqlDataAdapter dae = new SqlDataAdapter(cmd))
            {
                DataTable dt = new DataTable();
                dae.Fill(dt);
                rptrEvents.DataSource = dt;
                rptrEvents.DataBind();
            }
        }
    }
}

Open in new window

As a side note, this is really basic code. I would not recommend using inline SQL as per the above example. The example above is to illustrate the use of the SqlDataAdapter that you are missing in your code.
Note: Above code is also untested.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.