ListBox can't refresh the data, help! Thanks!

F

Franchdream

I use the AccessDataSource to fill the data for Listbox. I doesn't use the
DataSet.
But when I check button to update the database, the Listbox can't fresh the
data at onece.
And the Code which behind is no use:
private void setDataBind()
{
AccessDataSource2.Select(DataSourceSelectArguments.Empty);
AccessDataSource3.Select(DataSourceSelectArguments.Empty);
ListBox2.DataBind();
ListBox1.DataBind();
Page.DataBind();
}
Who can tell me how I would resolve it ? Thanks!

<asp:ListBox ID="ListBox1" runat="server" DataSourceID="AccessDataSource2"
DataTextField="itemname"
DataValueField="appnumber" Height="153px"
SelectionMode="Multiple" CausesValidation="True"></asp:ListBox>

<asp:AccessDataSource ID="AccessDataSource2" runat="server"
DataFile="~/App_Data/data.mdb"
SelectCommand="SELECT distinct appdata.appnumber,
appdata.itemname FROM appdata
WHERE ( appdata.appnumber not in
(SELECT distinct critique.appnumber FROM critique where expertid=? or
critique.appnumber in (select critique.appnumber from critique GROUP BY
critique.appnumber HAVING (COUNT(critique.appnumber) > 2))) AND
(appdata.studyarea = ?))">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" DefaultValue="0"
Name="expertid" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TreeView1" DefaultValue="0"
Name="studyarea" PropertyName="SelectedValue" />
</SelectParameters>
</asp:AccessDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top