return a recordset from ado.net

  • Thread starter Thread starter Ivar
  • Start date Start date
I

Ivar

Hi,

Just use SqlDataAdapter, use SqlDataAdapter.Fill() to fill DataSet, return
DataSet instead of SQLDataReader.
 
hi
i am trying to return a recordset from my web service to my c# app.


[WebMethod]
public SQLDataReader getAllCities()
{
string sqlQuery = "select CityName from city";
SqlCommand comm = new SqlCommand(sqlQuery,conn);
SqlDataReader reader = comm.ExecuteReader();
while(reader.Read())
{
Console.WriteLine(reader[0]);
}
return reader;
}


but i dont know how to return it.

also how can i view the results , when i invoke the webservice?



thanx

Zarish.
 
Back
Top