Hi,
Well I did try your suggestion. But it runs into overflow error when input length is more than desired length. I want to trap the error when user exceeds the length of input and display an error provider to user stating user has entered more value length than the required value length. How can I achieve this ?
Example Code:
var accountnatureadapter = new DataAccessAdapter();
var accountnature = new AccountnatureEntity();
accountnature.Description = tbxdescription.Text;
accountnature.Createddate = DateTime.Now;
accountnature.CreateduserId = 1;
#endregion
if (accountnatureadapter.SaveEntity(accountnature, true)) // Insert Data
{
message = ClubCentricBISpecific.Generic.datasavesuccess; // Message
ClubCentricBISpecific.Generic.ClearForm(this);
}
else
{
message = ClubCentricBISpecific.Generic.datasavefailure; // Message
}
MessageBox.Show(message);
Here user should not enter more than 100 characters for field tbxdescription.Text. but if he does so, it goes into runtime error. But I want to use the error provider to display message to user that more than 100 characters are not permitted.