When I'm quering in PHP something like that:
SELECT `ID`, `Name`, `EmailAddress` FROM `Accounts` WHERE `ID` = {$id}
I will return the result something in this sturcture:
{
"ID":1,
"EmailAddress":"banana@scale.com",
"Name":"Joseph"
}
When I'm quering in C# like that:
SqlCommand cmd = new SqlCommand("SELECT [ID], [Name], [EmailAddress] FROM [Accounts] WHERE [ID] = @ID", con);
cmd.Parameters.Add(new SqlParameter("@ID", id.ToString()));
SqlDataReader reader = cmd.ExecuteReader();
It'll return something in this sturcture:
(
0 : 1,
1 : "Joseph",
2 : "banana@scale.com"
)
My question is : how can I make the same sturcture in c#?