C# VS2008 Windows App: Get error when running method twice "A column named 'Name' already belongs to this DataTable"
C# VS2008 Windows App: Get error when running method twice
"A column named 'Name' already belongs to this DataTable"
Is there an easy way to avoid getting this when I let the user crun the method twice? Here is the code that errors when repeated. I understand the nature of the message looking for best "practice"\work around.
foreach (FileInfo file in files)
DataRow dr = dt.NewRow();
//get details of each file using file object
dr[Name] = file.FullName;
dr[Size] = file.Length;
dr[Ext] = file.Extension;
dr[Created] = file.LastWriteTime;
As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.