Hi Davidnyh,
How can I compare the datatypes and column names from two datatables? One is filed from excel and the other one is from a database.
You can get the name and type by the index of a certain column in this way - since you've got the two stings, you can compare them easily:
string name = ds.Tables[0].Columns[0].ColumnName; // e.g. "col1"
string ty = ds.Tables[0].Columns[0].DataType.ToString(); // e.g. "System.Int32"
How can I make a method that insert all the records from a datatable that cancel the inserted records as soon a value from a record is wrong for examle characters in an integer field. Or skip the record.
Could you clarify it? I can't understand your meaning.
Thanks.