使用 MySql 存储过程进行 .NET 数据访问层
我正在使用 .NET 2.0 和/或 3.5。 奇怪的是,每次我使用 MySQL 存储过程(无论是选择、更新、插入、删除)添加查询,无论是通过 TableAdapter 还是数据集中的普通查询,向导都不会完成(对话框突然消失) ,我回到设计器模式,并且查询未添加到表适配器或数据集表单中)。 MySQL 存储过程是否需要特殊格式,或者 MySQL 存储过程是否有解决方法?
我在用着 MySQL 5.1.33 便携式 XAMPP 1.7.1 PHP 5.2.9 阿帕奇2.2.11 phpMyAdmin 3.1.3.1
I'm using .NET 2.0 and/or 3.5. Weird thing is, everytime I add a query, whether via TableAdapter or a plain query in a Dataset, using a MySQL stored procedure (whether be a select, update, insert, delete), the wizard doesn't finish (the dialog suddenly disappears, I'm back to designer mode and the query isn't added to the tableadapter or dataset form). Is there a special formatting required for MySQL stored procedures, or a workaround for MySQL stored procedures to work?
I'm using
MySQL 5.1.33
portable XAMPP 1.7.1
PHP 5.2.9
Apache 2.2.11
phpMyAdmin 3.1.3.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了同样的事情。 对我来说,修复如下:我的存储过程参数之一是“filter”。 我将其更改为“p_filter”,问题就消失了。 我仍在处理的问题是在我得到的过滤器的最后一个屏幕上:
您的 sql 语法有错误; 检查与您的 mysql 服务器版本相对应的手册,了解在第 1 行“NULL”附近使用的正确语法。
我引入了一个不接受参数的存储过程,并且使用数据集向导创建 TableAdapter 没有任何问题。
I was having this same thing happen. The fix for me was the following: One of my parameters for the stored procedure was 'filter'. I changed it to 'p_filter' and the issue went away. The issue that I am still dealing with is on the last screen of the filter I get:
you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near 'NULL' at line 1
I brought in a stored procedure that doesn't accept a parameter and I have no issues with creating the TableAdapter using the dataset wizard.