473,406 Members | 2,956 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,406 software developers and data experts.

Show data in from DataSet in TextBox

Hello Group,
Sorry my english is very little.
I have problem with show data from Table from DataSet in textBox.
In my apps I have "typed DataSet" myDS with table TabPerson [idPerson,
LastName, FirstName, Adres, telefon]
On Form I have dataGrid with one column form TabPerson - with LastName and 3
textBoxes tbFName, tbAdres, tbTel.
Event DoubleClick for dataGrid is
tbAdres.Text = myDS.TabPerson[dataGrid.CurrentRowIndex].Adres;

If I don't sort column this work correct - because index in dataGrid is the
same as index in TabPerson.
My question is how get correct index from dataGrid to show data in textBox
if I sort columns?

Thx
PawelR
Nov 16 '05 #1
5 6771
Hi Pawel,

Use DataView to show your data in the DataGrid.
Its most universal way to access data by index or
state.
You can try to access: DataTable.DefaultView to get
current index, but i don't test it.

HTH
Marcin
Hello Group,
Sorry my english is very little.
I have problem with show data from Table from DataSet in textBox.
In my apps I have "typed DataSet" myDS with table TabPerson [idPerson,
LastName, FirstName, Adres, telefon]
On Form I have dataGrid with one column form TabPerson - with LastName and 3
textBoxes tbFName, tbAdres, tbTel.
Event DoubleClick for dataGrid is
tbAdres.Text = myDS.TabPerson[dataGrid.CurrentRowIndex].Adres;

If I don't sort column this work correct - because index in dataGrid is the
same as index in TabPerson.
My question is how get correct index from dataGrid to show data in textBox
if I sort columns?

Thx
PawelR

Nov 16 '05 #2
Pawel,

In a not strongly format it can be

\\\
dataGrid1.DataSource = ds.Tables[0].DefaultView;
textBox1.DataBindings.Add(new Binding("Text", ds.Tables[0].DefaultView,
"Pawel"));
////

I hope this helps?

Cor
Nov 16 '05 #3
Pawel,

Strongly typed it can be
\\\
dataGrid1.DataSource = ds.Pawel.DefaultView;
textBox1.DataBindings.Add(new Binding("Text",
ds.Pawel.DefaultView, "Pawel"));
///

I hope this helps?

Cor
Nov 16 '05 #4
Thanks,
this very good way.
Now, when my apps growing up I have new problem. I add to my Form new
dataGrid and I want show in this component data from child table, but I
don't know how binding this table. I have dataRelation object but this not
work. The same relation, I have in dataBase.

Thx PAwel
Użytkownik "Cor Ligthert" <no************@planet.nl> napisał w wiadomości
news:Oo**************@TK2MSFTNGP09.phx.gbl...
Pawel,

Strongly typed it can be
\\\
dataGrid1.DataSource = ds.Pawel.DefaultView;
textBox1.DataBindings.Add(new Binding("Text",
ds.Pawel.DefaultView, "Pawel"));
///

I hope this helps?

Cor

Nov 16 '05 #5
Thanks,
this very good way.
Now, when my apps growing up I have new problem. I add to my Form new
dataGrid and I want show in this component data from child table, but I
don't know how binding this table. I have dataRelation object but this not
work. The same relation, I have in dataBase.

Thx PAwel
Użytkownik "Cor Ligthert" <no************@planet.nl> napisał w wiadomości
news:Oo**************@TK2MSFTNGP09.phx.gbl...
Pawel,

Strongly typed it can be
\\\
dataGrid1.DataSource = ds.Pawel.DefaultView;
textBox1.DataBindings.Add(new Binding("Text",
ds.Pawel.DefaultView, "Pawel"));
///

I hope this helps?

Cor

Nov 16 '05 #6

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

Similar topics

1
by: Tarscher | last post by:
hi all, I have executed a query and put the result in a dataset. How can I get data from this dataset? Can I alter it directly or do I have to convert it into a new type to get the data from the...
3
by: JacksonYin | last post by:
1. I can fill data from Excel to DataSet like this: OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../Book1.xls;Extended Properties=Excel...
9
by: Fox | last post by:
I have create a dataSet and two table (father and son table) and set a relationship between them (call father_uid (int)). Is there any simple way, that I can get the row data include father and...
1
by: Nathan Sokalski | last post by:
I have retrieved data from a database using a SELECT statement that includes an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am having trouble getting the data from the...
0
by: @piranha | last post by:
hello, when i'm trying to save changed data from the dataset to datasource(an excel file) i get this error An unhandled exception of type 'System.InvalidOperationException' occurred in...
0
by: Raju | last post by:
Hi all i am Rajendran I am working as a asp.net programmer. I am frish to this field so please any of u garify my doubt I Create array of Textbox Dynamically and not passible to retrieve data...
1
by: Overseer | last post by:
I wanna take data from dataset which takes datas from Sql, to textbox.how can I read data from dataset.
5
by: Hetal | last post by:
Hi there.. I am a VB6 developer so kinda trying to figure how to work with VB.NET. I have a scenario where i have a DataSet bound to a combo box, and i would like to read a row from the DataSet...
1
by: subratamaji | last post by:
Hi, I am new to crystal report. Can any one plz guide how to use crystal report 11.5 with visual basic 6.0. Is it already included in visual basic 6.0 or will have to include it from...
2
by: satwinder singh | last post by:
Please help me regarding how to Export the Data from DataSet or GridView into Excel sheet. Kind Regards, Satwinder singh
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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...

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.