Hi,
In C#, i got sql Exception which consists of 2 lines.
I need only the 2nd line of that Exception only.
Ex:
The transaction ended in the trigger.
Table Validation failed - Name: x; Condition: m!=0
i need "Table Validation failed - Name: x; Condition: m!=0" only.
I have tried e.LineNumber but it not works well.
Can anyone help me?
Formatting or Handling Sql Exceptions in c#
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Hector Hugo Alpizar CesenaRank #5,573 · 294 reputationPosted Apr 29, 2010, 9:00 AM EDT
string[] linesInArray = strMsjException.Text.Split('\n');
string strResult = linesInArray[1]; //It's a base 0 array
Check the sample code in rar file splitingEnters.rar
Hector Hugo Alpizar CesenaRank #5,573 · 294 reputationPosted May 5, 2010, 9:44 AM EDT
chandruswami Ramalingam4 reputationPosted May 5, 2010, 8:00 PM EDT
Thanks