473,480 Members | 1,855 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to navigate in a dataset changing the text on a databound texbox

I just started with C#.
How do I navigate on a dataset by changing the value of a textbox or other
simple bound controls? Imagine that I have the customer name on a textbox
and have a datagrid with the orders that will display the orders of the
customer that the user enters on the textbox.
With combobox or lisbox the binding is automatically defined, but with
controls with simple bound I just can not figure it out a easy way to do it
Actually, what I want to do is a select on the dataset, depending on the information the user puts on textbox.text

Thank you in advance for any help.
Best regards,
Miguel Piedade
Nov 15 '05 #1
3 1774
Hi Meguel
There I tow method I can think about that helps you navigate A Table inside
a DataSet
First there is the find method
**The find method is a method of The DataTabel object , it returns a
row of data . To use the Find method you have to define the primary key
property of the data table and you have to be looking for a primary key
value
For example if you set the primary key property of table
named employee to the ID columns { employee.Primarykey = new DataRow[]
{ID}// it takes an array of datarows , even if the array contains one value}
Then you can get the row of the employee that has an id equal to 500 this
way
DataRow result =Employee.Rows.Find("500");
** the other method is select which is also a method of the DataTable
object . you give as Argument to the select method an SQL statement an it
return an array of refernce to the data rows that matches as follows
DataRow[] result = employee.Select("ID= 500");

Hope that would help

Nov 15 '05 #2
You can also try
this.BindingContext[DataSetControl, "Table Name Here"].Position++ to navigate to the next record
o
this.BindingContext[DataSetControl, "Table Name Here"].Position-- to go prior.
Nov 15 '05 #3
You can also try
this.BindingContext[DataSetControl, "Table Name Here"].Position++ to navigate to the next record
o
this.BindingContext[DataSetControl, "Table Name Here"].Position-- to go prior.
Nov 15 '05 #4

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

Similar topics

3
1882
by: Alpha | last post by:
Hello. I am not a C++ programmer...I have studied a bit of Java, but that's it. However, I am playing an online game written in C++. I was wondering how one could change the color of text (that...
1
1768
by: Andy Bates | last post by:
Hi - I need to change the text of a subitem in a listview (in details view), but the text doesn't change; can anyone tell me how to achieve this? TIA - Andy
2
325
by: mjpiedade | last post by:
I just started with C#. How do I navigate on a dataset by changing the value of a textbox or other simple bound controls? Imagine that I have the customer name on a textbox and have a datagrid...
3
8531
by: David | last post by:
using c# in VS2003 in compact framework Hi, I am looking for some examples on how to convert a Dataset to text file. My application reads the dataset from SQL Server and displays it in a...
11
19804
by: scorpion53061 | last post by:
Well I had a way to write an array to an excel spreadsheet but on a huge time critical run it failed iwth the dreaded HRESULT: 0x800A03EC error. It worked fine when i sampled the data to go in but...
1
1018
by: Boni | last post by:
Dear Sirs, how is it possible to know if all text in a textbox is visible or the text was too long and a part is invisible? So I need to know max number of characters in visible space.
1
1717
by: Opettaja | last post by:
How would I go about changing text labels on a parent form from a child? For example Changing text labels on Form1 from Form2, and Form2 is opened from Form1? Any suggestions would be greatly...
1
995
by: samoore33 | last post by:
<States> - <state> <id>NY</id> <Flat>False</Flat> <Value>Value1</Value> - <Taxes> - <Tax> <Min>Min1</Min> <Max>Max1</Max> <Value>Value2</Value>
5
1442
by: deegeorge | last post by:
Hi, I am creating a help document in asp.net.In that first i am giving the contents as links using anchor tag. When i am clicking one of the link it need to navigate to the corresponding...
0
7046
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
6908
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
7048
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,...
1
6741
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
5342
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,...
1
4783
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...
0
2997
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...
0
1300
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 ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.