开发者

Is it possible to retrieve the line number from an OleDbException caused by calling ExecuteNonQuery()?

开发者 https://www.devze.com 2023-01-08 17:45 出处:网络
We are calling ExecuteNonQuery on all files in a certain folder for version scripting and if there is a syntax error an exception is raised. I have been scanning MSDN for a way to get the line number

We are calling ExecuteNonQuery on all files in a certain folder for version scripting and if there is a syntax error an exception is raised. I have been scanning MSDN for a way to get the line number but haven't been able to find an开发者_开发问答ything yet. There is a 'SqlException' class which does contain the line number but the shared base class 'DbException' does not contain this member.


Use the SqlConnection, SqlCommand classes rather than OleDbConnection, OleDbCommand classes when accessing SQL Server.

0

精彩评论

暂无评论...
验证码 换一张
取 消