本文介绍了使用ADO.NET创建视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 是否有人尝试使用CREATE VIEW命令创建SQL7视图 和ADO.NET?如果是这样,当试图创建视图时,是否存在捕获SQL错误的技巧?我有一个VB.NET应用程序,可以使用其他的b ,可以根据现有的表和 列名等价表创建视图。如果我意外地引入了一个与另一列相同的列名 ,那么我最终会得到一个错误的CREATE VIEW SQL语句,如果你运行它在查询分析器 窗口中,您会收到如下错误: 服务器:消息4506,级别16,状态1,过程BAR,行2 每个视图中的列名必须是唯一的。视图中的列名''FOO'' ''BAR''被指定多次。 ExecuteNonQuery正在Try / Catch中完成但是Catch 无法抓住它' 有什么想法吗? 解决方案 Has anyone tried to create a SQL7 view using the CREATE VIEW commandand ADO.NET? If so, is there a trick in trapping a SQL error whentrying to create the view? I have a VB.NET app that, amoung otherthings, can create views based on existing tables and a table ofcolumn name equivalents. If I accidently introduce a column nameequivalent that is the same as another column, I end up with a CREATEVIEW SQL statement that is in error, if you run it in a query analyzerwindow you get an error like the following:Server: Msg 4506, Level 16, State 1, Procedure BAR, Line 2Column names in each view must be unique. Column name ''FOO'' in view''BAR'' is specified more than once.The ExecuteNonQuery is being done inside a Try/Catch but the Catchain''t catchin'' it!!!Any ideas? 解决方案 这篇关于使用ADO.NET创建视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-14 09:29