Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

C# Convert Json File to DataTable

 public DataTable Read(string filePath)
        {
            try
            {
                //check if json structure is okay (http://jsonlint.com)
                //generate object class http://www.jsonutils.com
             
                DataTable dt = new DataTable();
                dt = JsonConvert.DeserializeObject<DataTable>(File.ReadAllText(filePath));

                return dt;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Convert #Json #File #DataTable
ADD COMMENT
Topic
Name
1+3 =