Hi Friends, finally i created a solution for my question but i don't know that is it the best way for my question. The solution is -
fill the dataset from the database. Add one more column to the dataset named fullname. Using foreach loop for the rows of existion data set the value of added column to fullname as shown below -
DataSet ds = GetDataFromDatabase();
DataColumn col = ds.Tables["TableName"].Columns.add("fullName", (typeof) string);
foreach(DataRow row in ds.Rows)
{
row["fullName"] = row["FName"].ToString()+row["LName"].ToString();
}
col.Unique = true;
return ds;
try
{
DataRow row = ds.Tables["TableName"].NewRow();
row.BeginEdit();
row["FName"] = tbFName.Text;
row["LName"] = tbLName.Text;
row["fullName"] = tbFName.Text + tbLName.Text;
row.EndEdit();
ds.Tables["TableName"].Rows.Add(row);
}
catch(Exception ex)
{
if(ex.GetType() == typeof(ConstraintException))
{
MessageBox.Show("A person is already exist with the given First Name and Last Name");
}
}