I am pretty new at C# and .NET, but I\'ve made this code to call a stored procedure, and I then want to take the returned DataTable and convert it to JSON.
I use JavaScriptSerializer + LINQ
return new JavaScriptSerializer().Serialize( dataTable.Rows.Cast() .Select(row => row.Table.Columns.Cast() .ToDictionary(col => col.ColumnName, col => row[col.ColumnName])) .ToList() );