DataTable dataTable = new DataTable("Employee");
dataTable.Columns.Add("EmployeeName", typeof(string));
dataTable.Columns.Add("EmployeeAddress", typeof(string));
DataRow row = dataTable.NewRow();
row["EmployeeName"] = "gyansangrah";
row["EmployeeAddress"] = "India";
dataTable.Rows.Add(row);
using(SqlConnection connection = new SqlConnection(@"conn_string")) {
connection.Open();
using(SqlCommand command = new SqlCommand("InsertEmployee", connection)) {
SqlParameter param = new SqlParameter("@EmployeeList", SqlDbType.Structured);
param.Value = dataTable;
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(param);
command.ExecuteNonQuery();
}
}