Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code as follows


private SQLDAL SCon = new SQLDAL();
private DataTable dt = new DataTable();
private DataSet ds = new DataSet();
String Sql;

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
try
{
getdata();
}

catch (Exception ex)
{
LblErr.Text = ex.ToString();
return;
}
}

}


public SqlConnection con = null;
private string himtConnectionString = "Data Source=india;connect timeout = 120; Initial Catalog=sample;


public void Bindcon()
{
con = new SqlConnection();
con.ConnectionString = himtConnectionString;
if(con.State == ConnectionState.Closed)
{
con.Open();
}
}


private void getdata()
{
try
{
SCon.Bindcon();
Sql = "select category from Tb_Staff_Doubt_Register group by category order by category";
SqlDataAdapter adp = new SqlDataAdapter(Sql, SCon.con);
DataSet ds = new DataSet();
adp.Fill(ds);
Accordion1.DataSource = ds.Tables[0].ToString();
Accordion1.DataBind();
}
catch (Exception ex)
{
LblErr.Text = ex.ToString();
return;
}
}


source page code as follows

<ajax:Accordion ID="Accordion1" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" runat="server" SelectedIndex="0" FadeTransitions="true"
SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40"
RequireOpenedPane="false" AutoSize="None">

<panes>
<ajax:AccordionPane ID="AccPan1" runat="server">
<Header>
--</Header>
<content>
--

<ajax:AccordionPane ID="AccPan2" runat="server">
<Header>
--</Header>
<content>
--




i am displaying the data to accordion control from the database.

when i run the accordion panes is displayed. in that pane data are not displayed from the database.

from my above code what is the mistake i made. please help me.

regards,
narasiman P.
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900