The problems encountered in the training in this summary to avoid encountering the same problem in the future to find a half day to solve
"Rookie Problem Solving"
1. Data type error when converting JSON string when querying data " additional information: The DataSet does not support system.nullable<>. "
"Error" table. Columns.Add (Prop. Name, Prop. PropertyType) ; "Red is the error data type"
"Solution" to change the above sentence: table. Columns.Add (Prop. Name); To resolve this issue
/// <summary> ///Create a table/// </summary> /// <typeparam name= "T" ></typeparam> /// <returns></returns> Public StaticDataTable createtable<t>() {Type EntityType=typeof(T); DataTable Table=NewDataTable (entitytype.name); PropertyDescriptorCollection Properties=typedescriptor.getproperties (EntityType); foreach(PropertyDescriptor propinchproperties) { //table. Columns.Add (Prop. Name);//change this to solve the wrong problemtable. Columns.Add (Prop. Name, Prop. PropertyType);//data type error when converting JSON string when querying data " additional information: The DataSet does not support system.nullable<>. " } returntable; }
Summary of problems encountered in "training" project practice and solutions