private void AddRowToTable() { if (passGrid.Rows[TotRowCount].Cells[1].Value.ToString() != "") { UserName = passGrid.Rows[TotRowCount].Cells[1].FormattedValue.ToString(); } else {UserName = null; } if (passGrid.Rows[TotRowCount].Cells[2].Value.ToString() != "") { Password = passGrid.Rows[TotRowCount].Cells[2].Value.ToString(); } else { Password = null; } try { var dbCnn = ConnClass.ConDB(); { PassWord pas = new PassWord(); if (UserName != null || Password != null) { pas.UserName = UserName; pas.PassWord1 = Password; dbCnn.GetTable<PassWord>().InsertOnSubmit(pas); dbCnn.SubmitChanges(); BindDataGridView(); InitRowCount = passGrid.RowCount; } } }//end try catch (Exception ex) { throw ex; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)