Adding a Datarow

  • Thread starter Thread starter Vayse
  • Start date Start date
V

Vayse

As soon as I try to set rowFixtures.HomeTeamID I get an error:
"Object reference not set to an instance of an object."
What should I changes?

Dim rowFixtures As HTPlannerDataSet.LeagueFixturesRow
rowFixtures.HomeTeamID = "123"
rowFixtures.HomeTeamName = "Team A"
rowFixtures.AwayTeamID = "456"
rowFixtures.AwayTeamName = "Team B"
Me.HTPlannerDataSet.LeagueFixtures.AddLeagueFixturesRow(rowFixtures)
 
Vayse,

You cannot create a datarow when you don't have the columnsdescriptions
which are in the datatable.

So probably it will be something as
Dim rowFixtures As PlannerDataSet.LeagueFixturesRow
RowFixtures = HTPPlannerDataset.LeagueFixturesTable.NewRow
rowFixtures.HomeTeamID = "123"
rowFixtures.HomeTeamName = "Team A"
rowFixtures.AwayTeamID = "456"
rowFixtures.AwayTeamName = "Team B"
Me.HTPlannerDataSet.LeagueFixtures.AddLeagueFixturesRow(rowFixtures)
I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top