Silly point, how does datatable relate to the table in the database on the
disk? Do I drag the table onto a dataset from the server explorer?
Thanks
Regards
"Miha Markic" <miha at rthand com> wrote in message
Hi John,
Assuming you have DataTable instance myTable with primary key of one
integer
column, you might do:
[C#]
DataRow row = myTable.Rows.Find(2); // where 2 is value of primary key
you
are searching
[VB.NET]
Dim row As DataRow = myTable.Rows.Find(2)
If you have pk with more columns, you should pass new object[col1value,
col2value, ..] instead of 2.
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com
Thanks. Could you give me a small code example how to start?
Considering
that this table is not yet referenced in the project in any way.
Thanks
Regards
"Miha Markic" <miha at rthand com> wrote in message
Hi John,
In addition to Val's solution.
You can use also DataTable.Rows.Find method if you are querying on
primary
key.
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com
Hi
Is there an equivalent in vb.net for access's dlookup function? I
am
trying
to get a value from a table based on a condition without going
through
all
the dataset/dataadapter set-up.
I need something like this; return client.company where client.id
=
10.
Thanks
Regards