catch(System.Exception e)
{
for(int i=0;i<e.Error.Count;i++)
{
_errInfo += "Error Sequential Nubmer:" +i+ "\n" + "Error Info:" + e.Error
.Message + "\n" + "Error Source:" + e.Error
.Source + "\n" + "Program:" +e.Error
.Procedure;
}

error CS0117:'System.Exception' does not contain a definition for 'Error'
Pockey
Rick, your help is sincerely appreciated!
Then, in this case, how can I get the error infomation once exception occur
Dave Comer
If you would like to know how to check at which method the exception occurred, and in which object, you could do this with reflection. This is rather expensive, but might be useful... For more information, read this post on my blog.
dto
If you want this info, you'll have to get it yourself. Please take a look at the MSDN Library information on System.Exception members to see which info it contains and which it doesn't.
Bhasker
spartakiran
Rick, thks. But in the following snippet, System.Exception was replaced by SqlException, and the code works quite well. So, I think there must be similiar mechenism for System.Exception just as Error for SqlException.
catch(SqlException e)//<--works quite well!
.Message+ "\n" + "Error Source:" +e.Errors
.Source+ "\n" + "Program:" +e.Errors
.Procedure;
{
for(int i=0;i<e.Errors.Count;i++)
{
errInfo+="Error Sequential Number:" +i+ "\n" + "Error Info:" +e.Errors
}
Gerhard Brueckl