James Lowen
James Lowen

Reputation: 1

Using FindbyID method in Visual Studio

Having some issues using FindByID method in C#.

The program will not recognize the FindBy method when written out as below. No other parts of the code produce an error.

Database3DataSet.MemlistRow customerRow = Database3DataSet.MemlistDataTable.FindByID(Int32.Parse(textBox2.Text));

Examples seem to show the second half of the equation as

Database3DataSet.Memlist.FindByID(Int32.Parse(textBox2.Text));

e.g. not as a datatable. But this does not seem to be an option. Also Solution Explorer seems to show that DataTable is equal to table. So maybe this is a change present in Visual Studio 2022?

Furthermore I cannot declare anything a Dim as this does not seem to be recognized as a method.

I tried using the Select method but I cannot get this to work either. The help for this also seem to show the table called Memlist input and just that, not MemlistDataTable. so I wonder if this is the same problem.

I could actually get FindByID to be recognized as a method through different, simpler coding, but could not get further parts to work and I have lost the simple piece of code that got me there.

Upvotes: -2

Views: 235

Answers (1)

James Lowen
James Lowen

Reputation: 1

I had to add an instance of the DataTable above this code using var mc = new Database3DataSet.MemlistDataTable();

Upvotes: 0

Related Questions