Participant
1442 Points
2827 Posts
May 29, 2009 02:59 PM|demoninside9|LINK
Thanx Dear..... It is working..!!
But tell me what is the difference between these two blocks
yours...
txtFName.Text = arr[0].ToString(); txtLName.Text = arr[1].ToString(); txtDesignation.Text = arr[2].ToString(); txtEmail.Text = arr[3].ToString(); txtFaxno.Text = arr[4].ToString(); txtMobileNo.Text = arr[5].ToString(); txtPin.Text = arr[6].ToString(); txtPhone.Text = arr[7].ToString(); ddlTitle.SelectedIndex = ddlTitle.Items.IndexOf(ddlTitle.Items.FindByText(arr[8].ToString())); if (arr.Count > 9 && arr[9].ToString() != string.Empty) { RadioButtonList1.SelectedIndex = RadioButtonList1.Items.IndexOf(RadioButtonList1.Items.FindByText(arr[9].ToString())); }
Mine
txtFName.Text = arr[0].ToString(); txtLName.Text = arr[1].ToString(); txtDesignation.Text = arr[2].ToString(); txtEmail.Text = arr[3].ToString(); txtFaxno.Text = arr[4].ToString(); txtMobileNo.Text = arr[5].ToString(); txtPin.Text = arr[6].ToString(); txtPhone.Text = arr[7].ToString(); ddlTitle.SelectedIndex = ddlTitle.Items.IndexOf(ddlTitle.Items.FindByText(arr[8].ToString())); if (arr[9].ToString() != string.Empty) { RadioButtonList1.SelectedIndex = RadioButtonList1.Items.IndexOf(RadioButtonList1.Items.FindByText(arr[9].ToString())); }
I am not using thsi arr.Count > 9 &&
why should I check . If they are greater than 9 so they are if not then they are not ..
after all this code should work...!
thanx
Participant
1442 Points
2827 Posts
Re: How to check that an array item have value or not
May 29, 2009 02:59 PM|demoninside9|LINK
Thanx Dear..... It is working..!!
But tell me what is the difference between these two blocks
yours...