Click here to Skip to main content
15,920,110 members

Comments by panduRajju (Top 5 by date)

panduRajju 4-Apr-12 9:43am View    
and for previous button


objCourtDetails.Action = "select";
ds = objCourtDetails.CourtDetailsSelect_Bal(objCourtDetails);
////dgvCourtView.DataSource = ds.Tables[0];

//int i = Convert.ToInt32(txtCourtID.Text);
//if (i > -1 || i != 0)
if (i == ds.Tables[0].Rows.Count - 1 || i != 0)
{
i--;
txtCourtID.Text = ds.Tables[0].Rows[i]["ID"].ToString();
txtcomboCourtType.Text = ds.Tables[0].Rows[i]["CourtType"].ToString();
txtCourtCode.Text = ds.Tables[0].Rows[i]["CourtCode"].ToString();
txtCourtName.Text = ds.Tables[0].Rows[i]["CourtName"].ToString();
txtCourtLocation.Text = ds.Tables[0].Rows[i]["CourtLocation"].ToString();
txtCity.Text = ds.Tables[0].Rows[i]["City"].ToString();
txtState.Text = ds.Tables[0].Rows[i]["State"].ToString();
txtCountry.Text = ds.Tables[0].Rows[i]["Country"].ToString();
txtZipCode.Text = ds.Tables[0].Rows[i]["ZipCode"].ToString();
txtURL.Text = ds.Tables[0].Rows[i]["URL"].ToString();
txtWorkPhone.Text = ds.Tables[0].Rows[i]["WorkPhone"].ToString();
txtEmailAddress.Text = ds.Tables[0].Rows[i]["EmailAddress"].ToString();
txtFAX.Text = ds.Tables[0].Rows[i]["FAX"].ToString();
txtOther.Text = ds.Tables[0].Rows[i]["Other"].ToString();
txtNote.Text = ds.Tables[0].Rows[i]["Note"].ToString();
txtComments.Text = ds.Tables[0].Rows[i]["Comments"].ToString();
//txtComments.Text = ds.Tables[0].Rows[i]["DateofEntered"].ToString();
//txtComments.Text = ds.Tables[0].Rows[i]["Comments"].ToString();
}

else
{
//no records to see more.
}
}
panduRajju 4-Apr-12 9:41am View    
my code in another form is

private void btnNext_Click(object sender, EventArgs e)
{

objCourtDetails.Action = "select";
ds = objCourtDetails.CourtDetailsSelect_Bal(objCourtDetails);
//nt i = Convert.ToInt32(txtCourtID.Text);
////dgvCourtView.DataSource = ds.Tables[0];

//if( i >-1 )
if (i < ds.Tables[0].Rows.Count - 1)
{
//nt j = i + 1;
i++;
txtCourtID.Text = ds.Tables[0].Rows[i]["ID"].ToString();
txtcomboCourtType.Text = ds.Tables[0].Rows[i]["CourtType"].ToString();
txtCourtCode.Text = ds.Tables[0].Rows[i]["CourtCode"].ToString();
txtCourtName.Text = ds.Tables[0].Rows[i]["CourtName"].ToString();
txtCourtLocation.Text = ds.Tables[0].Rows[i]["CourtLocation"].ToString();
txtCity.Text = ds.Tables[0].Rows[i]["City"].ToString();
txtState.Text = ds.Tables[0].Rows[i]["State"].ToString();
txtCountry.Text = ds.Tables[0].Rows[i]["Country"].ToString();
txtZipCode.Text = ds.Tables[0].Rows[i]["ZipCode"].ToString();
txtURL.Text = ds.Tables[0].Rows[i]["URL"].ToString();
txtWorkPhone.Text = ds.Tables[0].Rows[i]["WorkPhone"].ToString();
txtEmailAddress.Text = ds.Tables[0].Rows[i]["EmailAddress"].ToString();
txtFAX.Text = ds.Tables[0].Rows[i]["FAX"].ToString();
txtOther.Text = ds.Tables[0].Rows[i]["Other"].ToString();
txtNote.Text = ds.Tables[0].Rows[i]["Note"].ToString();
txtComments.Text = ds.Tables[0].Rows[i]["Comments"].ToString();
//txtComments.Text = ds.Tables[0].Rows[i]["DateofEntered"].ToString();
//txtComments.Text = ds.Tables[0].Rows[i]["Comments"].ToString();

}
else
{
//no records to see more.
MessageBox.Show("No Records Found");
}

}
panduRajju 4-Apr-12 9:37am View    
no selecteditem and selectedindex
panduRajju 4-Apr-12 9:01am View    
in another form the data in binding to textboxes. if i click next button i want
display details of next record and previous button for previous record
panduRajju 4-Apr-12 1:15am View    
thanq u for your response but its not working
my requirement is i have data in datagridview when i click by celldoubleck event
the perticular row data goes to another form.from that form when i click next or previous button it navigating from begining record onwards.but i want to navigate from selected record onwards.