I want to get line number of code which cause error. For example;
static void Main(string[] args) { using (SqlConnection conn = new SqlConnection(bagcum)
To get line numbers, you need your application to be in Debug mode or include the debug symbols in the same folder (the .pdb file) for line numbers to appear. You code as posted should then work.