Try
CommonData xCommonData = new CommonData();
string sMethod = System.Reflection.MethodInfo.GetCurrentMethod().Name;
xCommonData.WriteEventError(MODULE_NAME, sMethod, ex, "");
MODULE_NAME you need to declare as a constant
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.