<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Naveed Akhtar - All Comments</title><link>http://weblogs.asp.net/navaidakhtar/default.aspx</link><description>Each success only buys an admission ticket to a more difficult problem -- Henry K.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Debug Build: 20510.895)</generator><item><title>Working with ASP.Net Webservice on Vista / Windows Server 2008 (IIS 7)</title><link>http://weblogs.asp.net/navaidakhtar/archive/2009/04/05/working-with-asp-net-webservice-on-vista-windows-server-2008-iis-7.aspx#7025711</link><pubDate>Sat, 04 Apr 2009 22:15:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7025711</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7025711" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#7025708</link><pubDate>Sat, 04 Apr 2009 22:12:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7025708</guid><dc:creator>NavaidAkhtar</dc:creator><description>&lt;p&gt;Danny117, Basically, I am using just a simple technique to convert the dataset to JSON string. &lt;/p&gt;
&lt;p&gt;Actually on the code behind i am serializing the data into a format, that is known as JSON format, and with the single line on client side (Javascript) &lt;/p&gt;
&lt;p&gt;var JObject = eval('(' + JSONString + ')');&lt;/p&gt;
&lt;p&gt;I am deserializing to a JSon Object and then Iterating over the object. &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7025708" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#7025707</link><pubDate>Sat, 04 Apr 2009 22:08:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7025707</guid><dc:creator>NavaidAkhtar</dc:creator><description>&lt;p&gt;CRajkumar.ece, Please see your table data, as it contains some illegle chracters like &amp;quot; ' &amp;quot;, try these by using the technique of javascript error free chracter replacement. I will work fine.&lt;/p&gt;
&lt;p&gt;If you still have an issue, just shoot me a mail including the code, the resuly set data. I will try to solve your issue.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7025707" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#7002911</link><pubDate>Thu, 26 Mar 2009 06:52:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7002911</guid><dc:creator>CRajkumar.ece</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;var JObject = eval(&amp;#39;(&amp;#39; + JSONString + &amp;#39;)&amp;#39;);&lt;/p&gt;
&lt;p&gt;I am New to this concept of json, the above tatement is retunring a error for me. It throws error as &amp;quot;Excepted &amp;#39;(&amp;#39;&amp;quot;. Can you help me out.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7002911" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#6830412</link><pubDate>Mon, 12 Jan 2009 02:44:05 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6830412</guid><dc:creator>Danny117</dc:creator><description>&lt;p&gt;Just what I was looking for. Bookmarked! Simple expanation of how to deserialize table.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6830412" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#6754416</link><pubDate>Wed, 26 Nov 2008 03:58:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6754416</guid><dc:creator>Ron</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; This looks like a very fragile method&lt;/p&gt;
&lt;p&gt;RichardD, what I think is fragile is whatever the latest Microsoft .NET fad is. Apparently that&amp;#39;s LINQ now, so I guess you think that everyone should keep up with the latest thing. I personally prefer timeless and simple solutions like the one Navid posted here. I think it&amp;#39;s rude for you to use a term like &amp;quot;fragile&amp;quot; to describe someone else&amp;#39;s code. Who do you think you are, Bill Gates, Jr.?&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6754416" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#6383400</link><pubDate>Thu, 10 Jul 2008 10:56:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6383400</guid><dc:creator>NavaidAkhtar</dc:creator><description>&lt;p&gt;Hi RichardD &lt;/p&gt;
&lt;p&gt;Thanks for your feedback and a wonderful suggestions, but your answer also contradicts your answer beceause, you stated that your solution works on .Net 3.5 or above then .Net 2.0. But My solution is for developers having .Net 2.0 or may be prior to that. &lt;/p&gt;
&lt;p&gt;LINQ, JSonSerializer, are not supporting in Net 2.0 or prior versions.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6383400" width="1" height="1"&gt;</description></item><item><title>re: Converting Data Table / Dataset Into JSON String</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/08/converting-data-table-dataset-into-json-string.aspx#6381113</link><pubDate>Wed, 09 Jul 2008 20:10:35 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6381113</guid><dc:creator>RichardD</dc:creator><description>&lt;p&gt;This looks like a very fragile method. If you&amp;#39;re using .NET 3.5 (or the MS AJAX 1.0 library), you already have the JavaScriptSerializer which does most of the work. &lt;/p&gt;
&lt;p&gt;Unfortunately, the DataTable and DataSet objects aren&amp;#39;t suitable for JSON serialization directly; you&amp;#39;ll need to convert them first. To duplicate your results, you need to convert the DataSet to an IDictionary&amp;lt;string, IEnumerable&amp;lt;IDictionary&amp;lt;string, object&amp;gt;&amp;gt;&amp;gt;.&lt;/p&gt;
&lt;p&gt;With LINQ, the code is fairly simple:&lt;/p&gt;
&lt;p&gt;static object RowsToDictionary(this DataTable table)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var columns = table.Columns.Cast&amp;lt;DataColumn&amp;gt;().ToArray();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return table.Rows.Cast&amp;lt;DataRow&amp;gt;().Select(r =&amp;gt; columns.ToDictionary(c =&amp;gt; c.ColumnName, c =&amp;gt; r[c]));&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static Dictionary&amp;lt;string, object&amp;gt; ToDictionary(this DataTable table)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return new Dictionary&amp;lt;string, object&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ table.TableName, table.RowsToDictionary() }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static Dictionary&amp;lt;string, object&amp;gt; ToDictionary(this DataSet data)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return data.Tables.Cast&amp;lt;DataTable&amp;gt;().ToDictionary(t =&amp;gt; t.TableName, t =&amp;gt; t.RowsToDictionary());&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public static string GetJSONString(DataTable table)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;JavaScriptSerializer serializer = new JavaScriptSerializer();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return serializer.Serialize(table.ToDictionary());&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public static string GetJSONString(DataSet data)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;JavaScriptSerializer serializer = new JavaScriptSerializer();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return serializer.Serialize(data.ToDictionary());&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6381113" width="1" height="1"&gt;</description></item><item><title>re: ASP.Net Compilation and Merge Tool (Part 2 of 2)</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/03/asp-net-compilation-and-merge-tool-part-2-of-2.aspx#6375785</link><pubDate>Tue, 08 Jul 2008 10:31:30 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6375785</guid><dc:creator>NavaidAkhtar</dc:creator><description>&lt;p&gt;Hi Tony&lt;/p&gt;
&lt;p&gt;ASP.NET Merge tool can be used in three options: &lt;/p&gt;
&lt;p&gt;Merge all outputs into a single assembly.&lt;/p&gt;
&lt;p&gt;&amp;quot;Merge each folder's Web UI content (Web pages, skins, and so on) into its own assembly.&amp;quot;&lt;/p&gt;
&lt;p&gt;Merge all Web UI content in the site into a single assembly.&lt;/p&gt;
&lt;p&gt;Answer to your question is in &amp;quot; &amp;quot;.&lt;/p&gt;
&lt;p&gt;Any Questions / Queries?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Naveed Akhtar&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6375785" width="1" height="1"&gt;</description></item><item><title>re: ASP.Net Compilation and Merge Tool (Part 2 of 2)</title><link>http://weblogs.asp.net/navaidakhtar/archive/2008/07/03/asp-net-compilation-and-merge-tool-part-2-of-2.aspx#6375584</link><pubDate>Tue, 08 Jul 2008 09:13:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6375584</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;Do you know if it is possible to add/compile new controls and pages to an existing precompiled (updateable) ASP.NET website ?&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6375584" width="1" height="1"&gt;</description></item></channel></rss>