Search code examples
c#visual-studio-2008tableadaptergenerated-code

Lost parameter names in TableAdapter generated Insert method


I'm trying to generate a Insert method in a TableAdapter with a query like

INSERT INTO Status
                  (ScheduleID, StatusID, Name, Color)
VALUES     (?, ?, ?, ?)

Here Name is a string and the other are integers. The generated signature however looks like this:

InsertQuery(int Color, string Param2, string Param3, string Param4)

Which does not match the query, either in name or order of parameter types.

How can this happen? How can I be sure that Parameter2 is StatusID if I decide to change it manually?


Solution

  • See the code(xml), change them according to it(open xml schema of your dataset and do that there). You can change their names to whatever you like.