473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

c# ListBox X2 DataTableX2 copy all between

77
Ill start by outlining whats in place currently.
tblData will display a list of people that can be used based on a set of filters that can be set on a filters above (name age etc.etc.). This tbl is a datasource for lbData... Then i have tblTo. this is a datasource for lbTo (original eh?). I want to be able to copy people between the two DataTables to show a receipiants listbox(lbTo) and then everyone else in the other.

If there are no filters applied and i want every one its a strait tblTo = tblData.Copy(); If there are filters applied then firstly i only want the ones wich are filtered (which is fine because the datatable only contains the filtered results the main list is stored elsewhere). The problem is. Say i want all people in tech so i filter tech and add all. Fine no problem. Now if i go find all the billing people and add them all. i dont want to overwrite the people already copied so i cant just do tblTo = tblData.Copy();... I tried using merge but my app seemed to crash. Ive already got it for copying single or mutliple (although im going to try speed it up).

Anyone got a way of transfering the data(all data in tblData -> tblTo). Doing it in reverse should be easy cos i just clear tblTo... also the filters dont get applied to tblTo.

Many Thanks,
Regards,
Piercy

Edit: tblTo.Merge(tblData); works however it takes about 5 minutes to complete... I dont think this way is viable unless im doign something wrong. The total people int he database at the moment is 2500 so im not expecting it to be lightning quick btu i think 5 minutes ish is too slow.
Jan 24 '08 #1
1 1046
piercy
77
Ok, ive put some timing checks in and it seems the problem aint copying them its remmoving them from the old table. Doing Row.Delete(); then table.Accept and doing table.rows.remove(row); Both seem to be slow(ish) but when you working on 2500 value even 0.2 seconds per result is a bit much really.

Any Ideas?
Jan 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ray | last post by:
Folks, I have just created a simple procedure that does the following: Determines the width of the columns of a listbox. Places a button of the correct size above each column as the form opens....
1
by: Islamegy | last post by:
I have 2 listbox binded to 2 datasource, one for the granted Roles & the other to display all roles.. i set the DisplayMember to "RoleName" & valueMemeber to "RoleID". I have 2 button to copy...
6
by: Janaka | last post by:
Help! I have two ListBox controls on my web form. The first one gets populated on entry with values from the DB. I then use JavaScript to copy options from this ListBox to my second one. (I...
9
by: Murat Kelleci | last post by:
How do i reach a listbox in form1 from a module? i thinks it is not so easy as it seems, i tried such like : dim myform as new form1 form1.listbox1. and dim myform as form1
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
14
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...
4
by: Jeff | last post by:
....still new at this. ...hopefully a simple question Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on each...
3
by: Brian Simmons | last post by:
Hi All, I search on codeproject and google but didn't find what I was looking for. Anybody know of a good implementation where you have 2 listboxes and you want to move items between the 2. ...
8
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.