2013年9月18日 星期三

ASP.NET中使用MySQL宣告變數的問題 Parameter ‘@id’ must be defined

有遇到MySql.Data.MySqlClient.MySqlException: Parameter ‘@id’ must be defined這樣的問題的話

到設定Connection String Setting的地方加上Allow User Variables=True就可以了


ex.Database=testdb;Data Source=localhost;User Id=root;Password=hello;Allow User Variables=True