Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Suppose i have 10 records in database and a form having a gridview with text boxes. I have to retrieve data from database and populate the above control. And by using navigation key have to show data in all that control.

so how to do this,please somebody help me.
Posted
Updated 21-Sep-12 3:00am
v2
Comments
Sandeep Mewara 21-Sep-12 9:04am    
1. Not too clear.
2. What have you tried so far?
Shivani Dash 24-Sep-12 2:40am    
Had done almost bt nt wrkg,,if psbl suggest me some solutions...

Do you mean something like MS Access's record view?

You Could use a dataset to bind fields
 
Share this answer
 
Comments
Shivani Dash 24-Sep-12 2:39am    
cant do through datatable?
Shivani Dash 24-Sep-12 2:42am    
cant we do by using dataset?
Shivani Dash 24-Sep-12 2:43am    
sorry...nt dataset i mean datatable
darkliahos 24-Sep-12 18:11pm    
Well if you were trying to bind to textboxes then yes Datasets would be the answer but I have reread your question and it sounds like you need a dataview.

You can read about them here: http://msdn.microsoft.com/en-us/library/wbe40x3x%28v=vs.71%29.aspx
Shivani Dash 25-Sep-12 1:55am    
thank u so much 4 gvng me ur such precious time....bt i solvd ds.. :)
First have to write a method[ShowData()] through which we can show the entire data which are populating in the given controls...and have to declare a variable(BILLNo) before pageload.Then in every button click just write,

private void btnFirst_Click(object sender, EventArgs e)
{
if (BILLNo == 1)
{
MessageBox.Show("Already at First Page...!");
}
else
{
BILLNo = 1;
ShowData();
}


}


private void btnPrev_Click(object sender, EventArgs e)
{
if (BILLNo == 1)
{
MessageBox.Show("Already at First Page..!");
}
else
{

BILLNo--;
ShowData();

}
}

private void btnNext_Click(object sender, EventArgs e)
{

if (BILLNo==bill)
{
MessageBox.Show("Already at Last Page..!");
}
else
{

BILLNo++;
ShowData();
}

}

private void btnLast_Click(object sender, EventArgs e)
{

if (BILLNo==bill)
{
MessageBox.Show("Already at Last Page..!");
}
else
{

BILLNo =bill;
ShowData();
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900