0

I used the dataset designer to access the database.
And I do not understand why I'm getting no data.

Please tell me how to fix that

usersTableAdapter usersTA = new usersTableAdapter();
var usersTable = new users.usersDataTable();
usersTA.Fill(usersTable);

partnersTableAdapter partnersTA = new partnersTableAdapter();
var partnersTable = new users.partnersDataTable();
partnersTA.Fill(partnersTable);

VK_BDayParser.users.usersRow row = usersTable.FindByid(currentItem.id);
var partners = row.GetpartnersRows();

partners is always zero-lenghted array, but in the database table partners has many rows

Georgy Tarasov
  • 1,534
  • 9
  • 11
  • Have you debugged `usersTable` after `usersTA.Fill(usersTable);` to check that it actually contains data? – Bernd Linde Feb 16 '15 at 09:48
  • @BerndLinde yes, it contains data. I normally add or change data in the table users, it just did not copy the code in question. – Georgy Tarasov Feb 16 '15 at 09:56
  • And you have debugged to check that `usersTable` contains atleast one row with the `id` in `currentItem.id`? – Bernd Linde Feb 16 '15 at 10:01
  • @BerndLinde Look, i have information in row... http://puu.sh/fZiFM/a781e0a12a.jpg – Georgy Tarasov Feb 16 '15 at 10:06
  • There is no direct link between your populated `usersTable` and the `partnersTable`. They are two different objects, so when you call `row.GetpartnerRows()`, there is no Partner data in the `usersTable` to return – Bernd Linde Feb 16 '15 at 10:34
  • @BerndLinde so, how can I connect them together? I cant understand why VS creates this method if it didnt work – Georgy Tarasov Feb 16 '15 at 10:42

0 Answers0