Share via

Why "MyTable" causes an error

BenTam-3003 686 Reputation points
2022-02-02T10:05:10.007+00:00

Dear All,

Why "MyTable" causes an error! The error is "Cannot implicitly convert type 'string' to 'int'".

170554-filldata.gif

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

Ken Tucker 5,866 Reputation points
2022-02-02T10:37:11.227+00:00

When creating an DataTable use () instead of [ ]

 DataTable dt - new DataTable("MyTable");

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.