1
Answer

Binding 2nd row from table into gridview.

Ask a question
How to display only second row from table to gridview?

 
I had written the code as follows: protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=.;database=test;trusted_connection=true");
SqlCommand cmd = new SqlCommand("select * from employee", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "newemp");
GridView2.DataSource = ds.Tables[0].Rows[1].ToString();
GridView2.DataBind();

}


But it is not giving correct output...

Answers (1)