常见问题: Character set 'gbk' is not supported 出现此问题,十有八九可能你用了底版本的MySQL Connector ,因为在MySQL Connector 1.07中提供的字符编码是有限的,找到不到web.config中设置的编码类型,没有gbk,不过好像有big5,具体请看MySQL Connector 1.07源码中的CharSetMap.cs文件,其中
publicstatic CharacterSet GetChararcterSet(DBVersion version, string CharSetName) { CharacterSet cs = (CharacterSet)mapping[CharSetName]; if (cs ==null) thrownew MySqlException("Character set '"+ CharSetName +"' is not supported"); return cs; }
privatestaticvoid LoadCharsetMap() { mapping.Add("latin1", new CharacterSet("latin1", 1)); mapping.Add("big5", new CharacterSet("big5", 2)); . }
而MySQL Connector 5.03中提供的字符编码相当全面了,所以建议使用5.03,不过5.03与旧版本的mysql数据库有些地方不太兼容。在执行存储过程等大的数据操作时会出现: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding