try{save.Username = usernamedetails.Rows[0].ItemArray[0].ToString(); }catch{ save.Username = ; }try { save.Firstname = dtdetails.Rows[0].ItemArray[1].ToString(); }catch { save.Firstname = ; }try { save.LastName = dtdetails.Rows[0].ItemArray[2].ToString(); }catch { save.LastName = ; }try { save.Address1 = dtdetails.Rows[0].ItemArray[3].ToString(); }catch { save.Address1 = ; }try { save.Address2 = dtdetails.Rows[0].ItemArray[4].ToString(); }catch { save.Address2 = ; }try { save.Postoffice = dtdetails.Rows[0].ItemArray[5].ToString(); }catch { save.Postoffice = ; }try { save.District = dtdetails.Rows[0].ItemArray[6].ToString(); }catch { save.District = ; }try{ save.State = dtdetails.Rows[0].ItemArray[7].ToString(); }catch{ save.State = ; }try { save.Country = dtdetails.Rows[0].ItemArray[8].ToString(); }catch { save.Country = ; }try { save.MobileNumber = dtdetails.Rows[0].ItemArray[9].ToString(); }catch { save.MobileNumber = ; }try { save.LandLine = dtdetails.Rows[0].ItemArray[10].ToString(); }catch { save.LandLine = ; }try { save.Pin = dtdetails.Rows[0].ItemArray[11].ToString(); }catch { save.Pin = ; }try { save.Cmpnyname = dtdetails.Rows[0].ItemArray[12].ToString(); }catch { save.Cmpnyname = ; }try { save.Design = dtdetails.Rows[0].ItemArray[13].ToString(); }catch { save.Design = ; }try { save.Loc = dtdetails.Rows[0].ItemArray[14].ToString(); }catch { save.Loc = ; }try { save.CmpnyPincode = dtdetails.Rows[0].ItemArray[15].ToString(); }catch { save.CmpnyPincode = ; }try { save.EmailID = dtdetails.Rows[0].ItemArray[16].ToString(); }catch { save.EmailID = ; }try { save.OffNumber = dtdetails.Rows[0].ItemArray[17].ToString(); }catch { save.OffNumber = ; }Is this type of strategy suitable for coding?
Saving a contact and dealing with exceptions
c#;exception handling