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>
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>