关于数据库错误: [英] about database error:-
本文介绍了关于数据库错误:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误:-
A using namespace directive can only be applied to namespaces; 'System.Data.SqlClient.SqlDataReader is type not namespace...
错误无法理解,所以 plz 请帮助我....
error cannot understand so plz please help me....
推荐答案
在您的名称空间部分中,请使用以下代码
in your name spaces section use the following code
using System.Data.SqlClient;
代替
instead of
using System.Data.SqlClient.SqlDataReader;
错误非常明显:
"System.Data.SqlClient.SqlDataReader的类型不是名称空间"
你不放
在您的代码中
The error is pretty explicit:
"System.Data.SqlClient.SqlDataReader is type not namespace"
You don''t put
using System.Data.SqlClient.SqlDataReader;
:您需要的是:
in your code: all you need is:
using System.Data.SqlClient;
,然后您可以直接访问SqlDataReader:
and then you can access the SqlDataReader directly:
SqlDataReader reader = mySqlCommand.ExecuteReader();
我认为错误消息本身具有解释性.您正在尝试在代码隐藏中声明如下内容:
I think the error message it explanatory itself. You are trying to state something like this in codebehind:
using CLASS NAME;
或
or
<add namespace="CLASS NAME" />
在web.config文件中.
就像说的那样,System.Data.SqlClient.SqlDataReader不是名称空间,而是一个类.祝你好运!
in web.config file.
As it says, System.Data.SqlClient.SqlDataReader is not a namespace but a class. Good Luck!
这篇关于关于数据库错误:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文