i have two gridviews....
first one--->Topic ,
second one is Question papers
1) when ever user click on first Topic database receive only first 15 questions display?
2) user click on second Topic database receive 16 to 30 question display?.....ect
how display .....plz help me ,,....

Jitendra KumarPosted Dec 11, 2014, 1:52 AM
May this help you.
find attached copy of code.
If this post is useful then mark it as "Accepted Answer".
Saber ShaikhPosted Jan 5, 2015, 12:47 AM
Chinna NethaPosted Dec 11, 2014, 3:58 AM
again again thank you so much
:) :) =D
Chinna NethaPosted Dec 10, 2014, 10:40 PM
ID
2) Topic table
Jitendra KumarPosted Dec 10, 2014, 10:25 PM
Kindly provides database table with record.
Chinna NethaPosted Dec 10, 2014, 9:22 PM
help me plz
Jitendra KumarPosted Dec 10, 2014, 12:52 PM
May this help you.
Aspx code :
CS Code :
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bindgv();
}
}
protected void Bindgv()
{
SqlConnection con = new SqlConnection("data source=LENOVO;initial catalog=practise;UID=sa;PWD=connect;");
con.Open();
SqlCommand cmd = new SqlCommand("SELECT TopicId, TopicName FROM tbl_Topic", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvTopic.DataSource = ds;
gvTopic.DataBind();
}
protected void gvTopic_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName=="Select")
{
SqlConnection con = new SqlConnection("data source=LENOVO;initial catalog=practise;UID=sa;PWD=connect;");
con.Open();
//Write your logic to get question
//SqlCommand cmd = new SqlCommand("SELECT QuestionId, QuestionName FROM tbl_Question -- where 'Your logic for get Code 1 to 15 etc topicwise'", con);
SqlCommand cmd = new SqlCommand("SELECT QuestionId, QuestionName FROM tbl_Question", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvQues.DataSource = ds;
gvQues.DataBind();
}
}
}
Also find attached copy of code.
If any doubt kindly revert me.
Chinna NethaPosted Dec 10, 2014, 7:50 AM
USER CLICK ON A TOPIC 1 TO 15 QUESTIONS... HOW TO DISPLAY?
USER CLICK ON B TOPIC 16 TO 31 DISPLAY....IN SAME GIRD VIEW
Jitendra KumarPosted Dec 7, 2014, 11:22 PM
Explain in proper requirements.
May this help you.
http://www.aspsnippets.com/Articles/Transfer-Selected-Rows-from-one-GridView-to-Another-in-Asp.net.aspx
http://www.aspdotnet-suresh.com/2013/05/move-selected-gridview-rows-to-another.html
Manish Kumar ChoudharyPosted Dec 7, 2014, 10:59 PM
what kind of help u need ?