DataSetToJson Extension Method

Source: Internet
Author: User

001 using System;

002 using System.Collections.Generic; 003 using System.Linq; 004 using System.Text; 005 using System.Data; 006   007 namespace Common 008 { 009   010      public static class JsonExtensions 011      { 012          # Region DataSetToJson Extension Method 013          /// <summary> 014          /// DataSetToJson Extension Method 015          /// </summary> 016          /// <Param name = "ds"> DataSet to be passed in </param> 017          /// <Param name = "JsonName"> Json name </param> 018          /// <Param name = "ParName"> Json field name </param> 019          /// <Returns> returns a JSON string </returns> 020          public static string DataSetToJson( this DataSet ds, string JsonName, string [] ParName) 021          { 022              try 023              { 024                  if (ds == null ) 025                  { 026                      return "DataSet Is Null ,So I Cant Do It To Json!" ;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.