Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:54:12+00:00 2026-05-27T05:54:12+00:00

I want to do the replication between Android sqlite & MS SQL server.That Time

  • 0

I want to do the replication between Android sqlite & MS SQL server.That Time i want to take Tables values from Databse.

This is my JSON

     {
   "Table1":[
      {
         "BusinessUnit":"MASS",
         "ProductCode":"SLD0201",
         "Description":"Lou Difan C.Blue 12"3- Commode",
         "Description2":"301 0201"

      },


      {
         "BusinessUnit":"MASS",
         "ProductCode":"SLN0502",
         "Description":"Lou Napoli I"vory- Cistern",
         "Description2":"2011 0502"

      },

      {
         "BusinessUnit":"MASS",
         "ProductCode":"LDMBL6H",
         "Description":"Dortek Taper Bullet Handle 6"5 serr ",
         "Description2":"Taper Bullet Ha"

      }

   ],
   "Table2":[
      {
         "chk":6,
         "currentchk":1
      }
   ]
}

In Here JSON Description column value contain “(double quotation) .If we check http://jsonformatter.curiousconcept.com/ , it show error.Its a Invalid JSON.

WCF service I have converted DataSet to JSON. Some table column contain special charters.

I converted like this :

       public String ConverTableToJson(DataSet dsDownloadJson,int currentSplit)
    {
        StringBuilder Sb = new StringBuilder();
        String result = "";
        int start = 0;
        int end =500;
        int chk = 0;
        int currentChk = currentSplit;
        if (dsDownloadJson.Tables.Count > 0)
        {
            Sb.Append("{");
            foreach (DataTable dt in dsDownloadJson.Tables)
            {
                DataTable dtDownloadJson = dt;
                string[] StrDc = new string[dtDownloadJson.Columns.Count];
                string HeadStr = string.Empty;
                double total = dtDownloadJson.Rows.Count;
                Console.WriteLine("--1--" + dtDownloadJson.Rows.Count);
                if (dtDownloadJson.Rows.Count < 500)
                {
                    end = dtDownloadJson.Rows.Count;
                }

                if (chk == 0)
                {
                    if (dtDownloadJson.Rows.Count > 500)
                    {
                        if ((dtDownloadJson.Rows.Count / 500) == 0)
                        {
                            chk = dtDownloadJson.Rows.Count / 500;
                        }
                        else
                        {
                            chk = dtDownloadJson.Rows.Count / 500 + 1;
                        }
                    }
                    else
                    {
                        chk = 1;
                    }
                    currentChk = 1;
                }
                else
                {
                    currentChk = currentChk + 1;
                    start = currentChk * 500;
                    end = start + 500;
                    currentChk = chk;
                }
                Sb.Append("\"" + dtDownloadJson.TableName + "1\" : [");

                if (dtDownloadJson.Rows.Count > 0)
                {
                    for (int i = 0; i < dtDownloadJson.Columns.Count; i++)
                    {
                        StrDc[i] = dtDownloadJson.Columns[i].Caption;
                        HeadStr += "\"" + StrDc[i] + "\" : \"" + StrDc[i] + i.ToString() + "¾" + "\",";
                    }

                    if (HeadStr.Length > 0)
                    {
                        HeadStr = HeadStr.Substring(0, HeadStr.Length - 1);
                        Console.WriteLine("--2--" + start);
                        Console.WriteLine("--3--" + end);
                        for (int i = start; i < end; i++)
                        {

                            string TempStr = HeadStr;
                            Sb.Append("{");
                            for (int j = 0; j < dtDownloadJson.Columns.Count; j++)
                            {
                                TempStr = TempStr.Replace(dtDownloadJson.Columns[j] + j.ToString() + "¾", dtDownloadJson.Rows[i][j].ToString());
                                TempStr = TempStr.Replace(""", '\"');
                            }

                            Sb.Append(TempStr + "},");
                        }

                        Sb = new StringBuilder(Sb.ToString().Substring(0, Sb.ToString().Length - 1));
                    }

                }
                else
                {

                }
                Sb.Append("],");
                if (chk > 1)
                {
                    Sb.Append("\"Table2\": [{\"chk\": " + chk + ", \"currentchk\": " + currentChk + " }]");
                }
                else
                {
                    Sb.Append("\"Table2\": [{\"chk\": " + chk + ", \"currentchk\": " + currentChk + " }]");
                }


            }
           // Sb = new StringBuilder(Sb.ToString().Substring(0, Sb.ToString().Length - 1));
            Sb.Append("}");
            return Sb.ToString(); 
        }
        else
        {
            return "0";
        }
    }

My problem is removing special charters OR How to allow special characters.?

Please help me anybody…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:54:13+00:00Added an answer on May 27, 2026 at 5:54 am

    You shouldn’t use a StringBuilder to convert an object to a JSON string. Use the JsonConverter class in JayRock JSON library and it takes care of Serialising/Deserialising Json for you (including escaping)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to do the replication between sql server & android sqlite.I have done
I have a sql server 2005 database that I want to setup replication for.
I have a database running under Sql server 2005 with merge replication. I want
I have 2 servers running SQL Server 2005 with merge replication set up between
I'm new to SQL Server replication options. I want to set up a system
I have a DataTable that contain 3000 records.I want to do the replication between
I want to setup replication on three SQL servers and one is not configured
Basically I want to setup a replication server for mysql datbase. I am completely
Is it possible to apply the Replication mechanism on single MySQL server? I want
Assuming I did all that is needed (consider complete replication) to make server A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.