Navigate in record formJSjmal salih12yAsked May 6, 2014, 1:02 AM EDT1 answerShareLinkedInXCopy linkSaveI wante c# code for (next-previous-first-last)windows form buttonsthank alot1 AnswerKnow the answer? Post it. Somebody with the same question will find it here.nacro cheick115 points12y agoPosted May 6, 2014, 4:27 AM EDT0hithis is an exemple codedatarow dRow;int pos;int maxrecord = ds.Tables[0].Rows.Count;CodeCopyprivate void NavigateRecords() { dRow = ds.Tables[0].Rows[pos]; txtFirstName.Text = dRow.ItemArray.GetValue(1).ToString(); txtSurname.Text = dRow.ItemArray.GetValue(2).ToString(); txtJobTitle.Text = dRow.ItemArray.GetValue(3).ToString(); txtDepartment.Text = dRow.ItemArray.GetValue(4).ToString(); } for your next button, increment pos.exempleprivate void Next(){ if(pos < maxrecord) { pos++; NavigateRecords() }}it's the same for previous.CodeCopyprivate void goLast() { pos=maxrecord; NavigateRecords() } 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign in
Navigate in record formJSjmal salih12yAsked May 6, 2014, 1:02 AM EDT1 answerShareLinkedInXCopy linkSaveI wante c# code for (next-previous-first-last)windows form buttonsthank alot
nacro cheick115 points12y agoPosted May 6, 2014, 4:27 AM EDT0hithis is an exemple codedatarow dRow;int pos;int maxrecord = ds.Tables[0].Rows.Count;CodeCopyprivate void NavigateRecords() { dRow = ds.Tables[0].Rows[pos]; txtFirstName.Text = dRow.ItemArray.GetValue(1).ToString(); txtSurname.Text = dRow.ItemArray.GetValue(2).ToString(); txtJobTitle.Text = dRow.ItemArray.GetValue(3).ToString(); txtDepartment.Text = dRow.ItemArray.GetValue(4).ToString(); } for your next button, increment pos.exempleprivate void Next(){ if(pos < maxrecord) { pos++; NavigateRecords() }}it's the same for previous.CodeCopyprivate void goLast() { pos=maxrecord; NavigateRecords() } 0
nacro cheick115 pointsPosted May 6, 2014, 4:27 AM EDT
this is an exemple code
datarow dRow;
int pos;
int maxrecord = ds.Tables[0].Rows.Count;
exemple
private void Next()
{
if(pos < maxrecord)
{
pos++;
NavigateRecords()
}
}
it's the same for previous.