日期:2014-05-17 浏览次数:20790 次
[FId] as [编号],[FName] as [姓名],[FSex] as [性别],[FPhone] as [电话号码],[Fqq] as [QQ],[FWordPhone] as [国际电话号码],[FEMail] as [EMail],[FHandSet] as [手机号]
DataRow rNew = _TableAccept.NewRow(); //添加新成员行.
//赋值信息.
rNew["编号"] = idVal;
rNew["姓名"] = nameVal;
rNew["性别"] = sexVal;
rNew["电话号码"] = phoneVal;
rNew["QQ"] = qqVal;
rNew["国际电话号码"] = worldPhoneVal;
rNew["EMail"] = emailVal;
rNew["手机号"] = handSetVal;
_TableAccept.Rows.Add(rNew);
_TableAccept = TableClass.AddressBook.UpdateMembersByDataTable(_TableAccept); //几时更新表,以防编号重复.
_AddSucceedCount += 1; //标志添加一个新成员.
MessageBox.Show("添加成功!");
//待编辑的成员行.
DataRow rSelected = _AcceptTable.Rows.Find(_SelectedMemberId); //这行报错.说没有主键.
//修改值.
//rSelected["编号"] = _SelectedMemberId;
rSelected["姓名"] = nameVal;
rSelected["性别"] = sexVal;
rSelected["电话号码"] = phoneVal;
rSelected["QQ"] = qqVal;
rSelected["国际电话号码"] = worldPhoneVal;
rSelected["EMail"] = emailVal;