I have a datatable with One ColumnName \"CustomerID\" with Integer DataType. Dynamically I want to add rows to the DataTable. For that, I had created one DataRow object like:
You need to check first
if (TextBox1.Text.Length > 0) { DR["CustomerID"] = Convert.ToInt32(TextBox1.Text); } else { DR["CustomerID"] = null; }