Code to refer
[WebMethod]
public static string GetData()
{
string query = "SELECT * FROM tblCountry";
SqlCommand cmd = new SqlCommand(query);
return GetData(cmd).GetXml();
}
private static DataSet GetData(SqlCommand cmd)
{
string strConnString = @"Data Source=.\sqlExpress;Initial Catalog=dbTest;Integrated Security=SSPI; pooling=false";
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
return ds;
}
}
}
}
See more at: Link
The query returns 20 rows and i need to show ten rows alone. Without any alteration in query is there any possibility to limit the data in dataset.Suggest some ideas