473,756 Members | 3,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Databinding and re-loading a Dataset

Hello,
I have a problem with re-loading datasets.

As a simple example, if I have an SQL table of addresses
comprising active and inactive addresss, I wish to load either
sub-set by clicking on a checkBox. The data is Bound to various
controls
on a Windows Form.

This works fine, I can load either set of data into the same
dataset and datatable, but the problem comes when navigating
the records using the BindingContext. When I switch from
active addresses to inactive addresses, then click on a navigator
button
I get the following error message:

'DataBinding cannot find a row in the list that is suitable for all
bindings'

I clear the dataset table before re-loading the data.
I have tried clearing and re-setting the Bindings on the controls
between loads
I have tried SuspendBinding( ) and ResumeBinding() between loads
I have re-set the Position of the BindingContext for the dataset/
datatable
I have tried re-setting the Position via a Currency Manager
I have Disposed and re-created the dataset

None of these work, I get the same error message

I am not doing any updating, editing or deleting on the data.

The only other thing of note is that when I first open the Winform
for active addresses the initial BindingContext Postion is 0

When I click on the checkBox to get the inactive addresses the
initial BindingContext Postion is 5 (ie total of 6 records, but why is
the Position not 0?)

thanks in advance for any comments

Chris Divine

Apr 17 '07 #1
0 2024

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

Similar topics

0
960
by: Victor Jones | last post by:
I have a general question about the approach towards databinding controls with objects. Apart from the databinding offered by .NET to bind data, it can be extended to have the same behavior with objects. Although, it seems a better way of doing things and provides an abstraction of code base, it hampers performance, as compared to the traditional approach. But just in the context of approach towards best practices towards developing...
0
1077
by: Victor Jones | last post by:
I have a general question about the approach towards databinding controls with objects. Apart from the databinding offered by .NET to bind data, it can be extended to have the same behavior with objects. Although, it seems a better way of doing things and provides an abstraction of code base, it hampers performance, as compared to the traditional approach. But just in the context of approach towards best practices towards developing...
0
1329
by: Wayne Sepega | last post by:
I have the following Object DataSource <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCustomer" TypeName="Customers" DataObjectTypeName="Customer" InsertMethod="InsertCustomer" OnUpdated="ObjectDataSource1_Updated" UpdateMethod="UpdateCustomer" OnSelected="ObjectDataSource1_Selected">
1
3083
by: Zak Lomakus | last post by:
Hi, From my main page (default.aspx) I am calling another .aspx (e.g. otherpage.aspx) page through Javascript using window.showModalDialog. otherpage.aspx has a databoud control (webchart), bound to a SQLDataSource. The first time otherpage.aspx is opened from default.aspx the databinding occurs and the page_load occurs on otherpage.aspx. When the user closes that modal form by clicking the close box ("X") at the top right corner of...
1
16261
by: Owen Blacker | last post by:
I've spent loads of time Googling to try to work this one out and I'm sure it's something obvious. I get an InvalidOperationException reading "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control" when I start my page. Unless I'm missing something obvious, this is *not* the same issue as the "2-way databinding cascading lists" issue in...
0
1190
by: rb | last post by:
I'm struggling with (probably) basic things using SqlDataSource and DataList. Here's the problem: I need to read the resultset returned by SqlDataSource to perform actions related to visual feedback and they should happen before databinding happens. So far, I tried to manually call Select to return DataView which then allows me to walk the DataView.Table.Rows. This is cool but then automatic databinding (DataList) kicks in and Select...
8
2090
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the generic type Field<T> (see sample code). public class Employee { public Field<stringForename
1
1632
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; Performance with databinding is good in asp.net 2.0 ? Would you prefer: databinding or set value to Text property of control ?
4
3318
by: Jason Wolf | last post by:
I have an object which runs in a sperate thread, from the main thread, and while running it updates a public property. In my main form I defined databinding on the property and I would like to see this databinding update my form property to reflect the value of the other components property, but it does not happen. My binding is Databinding.Add("Text",renderEngine,"Framerate"); When the property is initially set, to minus one, the text...
0
1084
by: nelsonbrodyk | last post by:
Hey All, I have been able to set up a databinding to a property with the following code: <TextBox x:Name="txtTextBox" Text="{Binding Path=NameFirst, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> and in the code: profile = context.NewProfile(); profile.NameFirst = "My Name"; txtTextBox.DataContext = profile;
0
9456
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
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
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...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5142
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...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.