【www.gdgbn.com--中文酷站】

ef之数据库教程连接问题与中文乱码解决方法


the specified named connection is either not found in the configuration, not intended to be used with the ent

1.首先修改

2.若是出现以下异常则说明执行程序所在的项目没有引用到该连接字符串

the specified named connection is either not found in the configuration, not intended to be used with the entityclient provider, not valid.

一般是连接字符串所在的app.config的问题,他必须出现在执行程序所在的那个web.config 或者是 app.config

关于中文乱码

oracle字符集 gbk ,nls_lanuage为amrican。vs21项目编码utf-8。。现在是对数据库进行新增记录时,英文和数字都没有问题。如果是中文 会提示ora-148: str 绑定值的结尾 null 字符缺失。


据说是 ms oracle provider 的原因,如果用 odp.net provider 就行了。但是我没有亲自试过,只是听说。

在查时发现在创建provider的时候有一个选项没选 、unicode false改为true 就好用了

本文来源:http://www.gdgbn.com/kuzhan/29936/