SqlCommand command = new SqlCommand(queryString, connection);
command.ExecuteReader();
I want to get json object which has "PackageID","PackageNumber","StatusName" from this sqlCommand.How can I do it?
SqlCommand command = new SqlCommand(queryString, connection);
command.ExecuteReader();
I want to get json object which has "PackageID","PackageNumber","StatusName" from this sqlCommand.How can I do it?
You can create an class that has the properties that you required. E.g.
class Package{
public string PackageID{get;set;}
public int PackageNumber{get;set;}
public string StatusName{get;set;}
}
Assign this object with reader, then use some JSON library to serialize the object to JSON object.