I have code that previously worked, however, after editing some fields within the database, I now get a Type Mismatch at the Data Adapter Fill command.
da.Fill(ds, "BundleInfo");
I have changed the field types in the database, and the format of some of the data, but it shouldn't affect the Fill command.
Field Type was Integer, now it is string
Same field used to hold data like: 1234 now might hold 1234U.
The SQL command (Really an Access DB, don't hate. :) ) is generated from:
public string getBundleDesc(string BundleCode)
{
string select = "SELECT P.ProductCode, P.ProductName, P.ProductDescription,
P.ListPrice, P.RecommendedPrice, P.MaxDiscount, P.PayStructure,
P.ProductNotes, P.ProductType, B.BundleOrder, B.IncApp";
string from = " FROM Bundle B";
string innerJoin = " INNER JOIN Product P";
string on = " ON B.ProductCode = P.ProductCode";
string where = " WHERE B.BundleCode = " + BundleCode;
string orderBy = " ORDER BY B.BundleOrder";
return select + from + innerJoin + on + where + orderBy;
}
The only change in this command was the inclusion of B.IncApp in the Select statement.
The db structure is (Don't hate on the structure, I inherited it :) ):
Table
Bundle
Fields
ID (PK, Auto)
BundleCode (Short Text)
ProductCode (Short Text)
BundleOrder (Number)
IncApp (Short Text)
Table
Product
Fields
ID (PK, Auto)
ProductCode (Short Text)
ProductName (Short Text)
ProductDescription (Long Text)
ListPrice (Short Text)
RecommendedPrice (Short Text)
MaxDiscount (Short Text)
PayStructure (Short Text)
ProductNotes (Short Text)
ProductType (Short Text)
The only changes to the DB structure are to Table -> Bundle -> BundleCode (Was Number, now a String) and the addition of the IncApp Field.
Updated the question with the information requested. Can someone point me in the right direction to fixing this?