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 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
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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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.
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |