根据MySQL .Net连接器文档,运行准备好的语句时,使用 @ 符号定义参数。尝试时我得到了一个错误。页面底部的用户评论说,如果遇到问题,用 ? 替换 @ 字符。是否有办法控制MySQL对准备好的语句期望的字符?我更喜欢它使用 "@" 符号,因为这会使其更类似于我正在迁移的SQL Server。
在VS中使用MySQL预处理语句?
原标题:
最佳回答
Old Syntax, OldSyntax: Allows use of @ symbol as a parameter marker. This option was deprecated in Connector/NET 5.2.2. All future code should be written using the @ symbol.
MySqlConnection myConnection = new MySqlConnection();
myConnection.ConnectionString = "**OldSyntax=true**; server=myHost; database=myDB; Username=myUser; pwd=myPass; ";
myConnection.Open();
问题回答
暂无回答
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding