그게 도움이 될 수도 있습니다.
다음 코드 예제에서는 DataAdapter의 FillError 이벤트에 대한 이벤트 처리기를 추가합니다. FillError 이벤트 코드에서이 예제는 정밀도 손실의 가능성이 있는지를 판별하여 예외에 응답 할 수있는 기회를 제공합니다.
adapter.FillError += new FillErrorEventHandler(FillError);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, "ThisTable");
protected static void FillError(object sender, FillErrorEventArgs args)
{
if (args.Errors.GetType() == typeof(System.OverflowException))
{
// Code to handle precision loss.
//Add a row to table using the values from the first two
columns.
DataRow myRow = args.DataTable.Rows.Add(new object[]
{args.Values[0], args.Values[1], DBNull.Value});
//Set the RowError containing the value for the third column.
args.RowError =
"OverflowException Encountered. Value from data source: " +
args.Values[2];
args.Continue = true;
}
}
참조 : https://msdn.microsoft.com/en-us/library/6d1wk41s(v=vs.110).aspx