Hi! I have a struct in a web service in c#. When I use "Selet * from TABLE1"; in a WebMethod I get a fully populated struct. But when I add a WHERE clause, I get null in response. Why is this? I have searched everywhere for a simple explanation but haven't found one.
How can I use a SELECT * FROM TABLE1 WHERE _id=" + id "'"; If I only want to retrieve a single post from the database it works fine, but not when I get a multiple row response.
Is there also a way of ordering a multiple-row response any way in c#?
Thanks in advance!
edit :
DataSet myDS = new DataSet();
try
{
myConnection.Open();
// Fill dataset with account data
//myCommand.Fill(myDS, "userdata");
myAdapter.Fill(myDS, "toplista");
myConnection.Close();
int i = myDS.Tables["toplista"].Rows.Count;
toplista[] mytoplista = new toplista[i];
i = 0;
foreach (DataRow row in myDS.Tables["toplista"].Rows)
{
mytoplista[i].name = row["_name"].ToString();
mytoplista[i].points = int.Parse(row["_points"].ToString());
mytoplista[i].level = row["_level"].ToString();
i++;
}
return mytoplista;