| | |
Problems with databindings
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Mar 2007
Posts: 68
Reputation:
Solved Threads: 0
I have a flat file database program I'm writing using SQLite3 and I've run into a problem and a question.
Problem: I have the various fields on the forms linked to the results of my queries using databindings. They all work just fine except for 2. They are pulled from a table after the rest of the data. They show up it I move to the next record and back but when I first get the results, everything else shows up but the 2. Any ideas?
Question: I want to have a label on the form that tells me where I am in the list and how many records there are. The formatting should be something like . Is there a way to do that with databindings so it updates as I scroll, even if I do a jump to the first or last record?
Thanks.
Problem: I have the various fields on the forms linked to the results of my queries using databindings. They all work just fine except for 2. They are pulled from a table after the rest of the data. They show up it I move to the next record and back but when I first get the results, everything else shows up but the 2. Any ideas?
Question: I want to have a label on the form that tells me where I am in the list and how many records there are. The formatting should be something like
C# Syntax (Toggle Plain Text)
String.Format("Record {0} of {1}", current, count);
Thanks.
•
•
Join Date: Mar 2007
Posts: 68
Reputation:
Solved Threads: 0
I select the parameters for the search and hit go. That populates the binding list.
I found a workaround but I would like to find a real solution. At the end of the search function, I call source.MoveLast() and then source.MoveFirst(). While this fixes the problem, I hate workarounds.
Also, I just finished adding all of my databindings and a section of them keep the rest from working.
The commented out ones are the problem. No idea why. The only thing different about them is they have their own group box.
I found a workaround but I would like to find a real solution. At the end of the search function, I call source.MoveLast() and then source.MoveFirst(). While this fixes the problem, I hate workarounds.
Also, I just finished adding all of my databindings and a section of them keep the rest from working.
C# Syntax (Toggle Plain Text)
//Account Bindings i_AR.DataBindings.Add("Text", source, "AR"); tx_Comments.DataBindings.Add("Text", source, "Comments"); i_CSID.DataBindings.Add("Text", source, "CSID"); i_Office.DataBindings.Add("Text", source, "Office"); i_Rep.DataBindings.Add("Text", source, "Rep"); i_Time.DataBindings.Add("Text", source, "Time"); i_Date.DataBindings.Add("Text", source, "Date"); //Equipment Bindings i_Desc.DataBindings.Add("Text", source, "System.Upgrades"); i_Upgrades.DataBindings.Add("Text", source, "System.Money"); /* i_Panel.DataBindings.Add("Text", source, "System.Panel"); i_Cell.DataBindings.Add("Text", source, "System.Cell"); i_DW.DataBindings.Add("Text", source, "System.Doors"); i_GB.DataBindings.Add("Text", source, "System.Glassbreaks"); i_MD.DataBindings.Add("Text", source, "System.Motions"); i_SMK.DataBindings.Add("Text", source, "System.Smokes"); i_KF.DataBindings.Add("Text", source, "System.Keyfobs"); i_WF.DataBindings.Add("Text", source, "System.Wallfobs"); i_Panic.DataBindings.Add("Text", source, "System.Panics"); */ //Customer Bindings l_Customer.DataBindings.Add("Text", source, "Person.Name"); l_Street.DataBindings.Add("Text", source, "Person.Address"); l_City.DataBindings.Add("Text", source, "Person.City"); l_State.DataBindings.Add("Text", source, "Person.State"); l_Zip.DataBindings.Add("Text", source, "Person.Zip"); l_Phone.DataBindings.Add("Text", source, "Person.Phone");
The commented out ones are the problem. No idea why. The only thing different about them is they have their own group box.
Last edited by toadzky; Oct 9th, 2008 at 9:34 pm. Reason: Another issue.
•
•
Join Date: Mar 2007
Posts: 68
Reputation:
Solved Threads: 0
Update: There is only 1 of the bindings that's causing a problem. I added them in 1 at a time until all but the i_Panel worked. When I uncomment that one, they all break.
ALso, on the workaround, the main problem with it is that it doesn't work for searches that only return 1 record.
Thanks again.
C# Syntax (Toggle Plain Text)
i_Desc.DataBindings.Add("Text", source, "System.Upgrades"); i_Upgrades.DataBindings.Add("Text", source, "System.Money"); // i_Panel.DataBindings.Add("Text", source, "System.Panel"); i_Cell.DataBindings.Add("Text", source, "System.Cell");
ALso, on the workaround, the main problem with it is that it doesn't work for searches that only return 1 record.
Thanks again.
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
You mentioned the additional fields are not part of the original query, as they are not fields, (its 6.30am and Im half asleep) and my brain is saying that Id expect you to be using an event to display the row number etc.. so.. what event are you using to trigger the update of those fields?
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Similar Threads
- .NET Consultant (Software Development Job Offers)
Other Threads in the C# Forum
- Previous Thread: different syntax for extending a class?
- Next Thread: stored procedure does not delete row
| Thread Tools | Search this Thread |
.net access ado.net algorithm array bitmap box buttons c# check checkbox client clock combobox connection console contorl control conversion csharp database datagrid datagridview dataset datetime degrees deployment draganddrop drawing dynamiccreation editor encryption enum excel file form format forms function gdi+ hospitalmanagementinformationsystem hospitalmanagementsystems i18n image imageprocessing input install java label list listbox math microsystems mouseclick mysql operator oracle path photoshop picturebox pixelinversion post programming property radians regex remoting richtextbox rows running... serialization server sleep soap socket sql sqlserver stack statistics string table teamsuite temperature text textbox thread time timer update uploadatextfile usercontrol validation visualstudio webbrowser whileloop windowsformsapplication winforms wpf write xml






