473,757 Members | 8,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

I use the AccessDataSourc e 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()
{
AccessDataSourc e2.Select(DataS ourceSelectArgu ments.Empty);
AccessDataSourc e3.Select(DataS ourceSelectArgu ments.Empty);
ListBox2.DataBi nd();
ListBox1.DataBi nd();
Page.DataBind() ;
}
Who can tell me how I would resolve it ? Thanks!

<asp:ListBox ID="ListBox1" runat="server" DataSourceID="A ccessDataSource 2"
DataTextField=" itemname"
DataValueField= "appnumber" Height="153px"
SelectionMode=" Multiple" CausesValidatio n="True"></asp:ListBox>

<asp:AccessData Source ID="AccessDataS ource2" runat="server"
DataFile="~/App_Data/data.mdb"
SelectCommand=" SELECT distinct appdata.appnumb er,
appdata.itemnam e FROM appdata WHERE ( appdata.appnumb er not in
(SELECT distinct critique.appnum ber FROM critique where expertid=? or
critique.appnum ber in (select critique.appnum ber from critique GROUP BY
critique.appnum ber HAVING (COUNT(critique .appnumber) 2))) AND
(appdata.studya rea = ?))">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Grid View1" DefaultValue="0 "
Name="expertid" PropertyName="S electedValue" />
<asp:ControlPar ameter ControlID="Tree View1" DefaultValue="0 "
Name="studyarea " PropertyName="S electedValue" />
</SelectParameter s>
</asp:AccessDataS ource>

Apr 1 '07 #1
0 1052

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7873
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've allso subclassed the window and do see all kinds of WS_??? messages coming by. But now I'm stuck :-\ I've got *no* idea what to do next, and all my searching on the web leads me
7
2010
by: Colleyville Alan | last post by:
I have an app in which users are displayed a list of mutual fund from which they can choose. There is a listbox embedded in a two-tabbed notebook control. When the form is initally opened, the listbox loads info: Private Sub Form_Open(Cancel As Integer) TabControl.Value = 0 Tab_Label1.Caption = "Select Alternatives from the Select List" FundAlternativesList.RowSource = "Load_Select_Alternatives_Form" Call Highlight_Defaults End Sub
3
9427
by: gdbjohnson-AT-yahoo-dot-ca-nospamplz | last post by:
I have a ListBox built of a simple custom object for the ListItems used to be able to hold a Data Value, and a Display Value, with accessors for each. I have overridden the ToString method to display the Display value. (Two examples that I have seen, including an MS example, suggest that the DisplayMember and ValueMember properties of the ListBox can be used in this way, I could not get it to work using the ListItems.Add method -...
1
8599
by: Bish | last post by:
I want to create a .Net page with 2 controls. The 1st is a dropdown being populated from a database. The 2nd control is a listbox which is also populated from the same database but the content is dependent upon a selection from the dropdown control. I have no DB issues but being new to ..Net want a slick way to refresh my listbox control without taking a round trip to the server to requery my DB stored Proc each time I select a...
1
4120
by: Tariq | last post by:
Hi, I have a list box that is bound to an arraylist, but when the data changes the listbox does not refresh. ----------------------------------------------------------------------------- al = new ArrayList(); al.Add("1");al.Add("2");al.Add("3");al.Add("4");al.Add("5");al.Add("6"); listBox1.DataSource = al; label1.Text = al.Count.ToString();
3
1025
by: Menu Chen | last post by:
See the code below,why my listbox can't refresh after my do the RemoveAt attribute in the event of Button1_Click I have used listbox1.refresh() and listbox1.update() ,but they didn't work any ideas,Thank you for your hel Private A As New ArrayLis Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa Dim i As Intege For i = 0 To A.Add(i * 100
2
1247
by: alanb | last post by:
This is driving me NUTS. I have a listbox bound to a datasource and it all works fine until I start deleting items from the class collection. The frustrating thing is that there is no pattern to the error and I can't recreate the problem with any certainty. I refresh the listbox after deleting a class item with the following code: With lstBanks .DataSource = Nothing .DisplayMember = "Title" .ValueMember = "BankID"
14
18749
by: Paul_Madden via DotNetMonster.com | last post by:
Basically I have a listbox to which I add simple STRING items- I have a progress bar which I increment whenever I populate another portion of the complete set of items I wish to add. What I observe is that as more and more are added, population of the list box takes longer and longer. ie the first 10th of the item set are added much much quicker than the last 10th. THis occurs with about 40,000 listbox items. My worry is the listbox may...
5
3481
by: rsteph | last post by:
I've got a list box that has about 6-7 columns with information, pulled from a table. When you click on a row in the list box it displays all the information in a series of text boxes, so that the information can be edited. I've got an add and delete button, so you can select a row in the listbox, then delete it; or enter information in the listboxes, then click the add button and add the information to the table. The buttons work fine with...
3
2001
by: Angel Blue01 | last post by:
I have a form with a binding navigator that draws from a database via drag-and-drop-created controls. I'm filling a listbox with the results of a query. The listbox contains data related to the record that the user is viewing but cannot be databound because other events and user input are needed when the user selects an item from the listbox. Each time the user clicks the binding navigator to move to the next record I have this: <code>
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.