Tag Archives: NewtonSoft

Convert DataTable to JSON

Here is the code: using System; using System.Data; using System.Data.SqlClient; using Newtonsoft.Json; namespace ConsAppJson { class Program { static void Main(string[] args) { SqlConnection conn = new SqlConnection(@”Data Source=localhost\sqlexpress;Initial Catalog=Northwind;Integrated Security=True”); SqlCommand command = new SqlCommand(“usp_NW_GetCategoriesById”, conn); command.CommandType = CommandType.StoredProcedure; … Continue reading

Posted in Uncategorized | Tagged | Leave a comment