I have a data table, and some columns are strings, some are decimal. When I add a row, will it automatically convert the info or do I have to convert them myself? I have a lot of data that I need to add in a table and currently I am using this:
DataRow row = dataTable.NewRow();
row["item1"] = Info[0];
row["Item2"] = Info[1];
row["item3"] = Info[2];
row["Item4"] = Convert.ToDecimal(Info[3]);
row[“…”] is a object and will take any type. If your Info[n] is a string you can convert it to the right type if need be. I don’t know if Info is a collection or not but if it is, why not do something like this instead: