<%@ Import Namespace="System.Data.Sql" %>换成
<%@ Import Namespace="System.Data.Sqlclient" %>
<%@ Import Namespace="System.Data.Sqlclient" %>
解决方案 »
- 第一次接触Infragistics NetAdvantage商业组件!求帮助!
- 高手帮忙啊!!如何在HttpWebRequest请求时让Session不丢失
- 如何在GridView里更新视图或者对两个关联在一起的表进行操作
- 问一个特别简单的传递参数的问题
- 文字在网页中显示是乱码!!!如何解决???
- 如何做到datagrid的打印,datagrid与datagrid上label的打印
- 存储过程创建临时表的问题
- easyui grid绑定不上数据
- 记录集绑定DataGrid,隐藏某一列不显示在DataGrid!
- 怎么在没有显式页面的类中访问xml文件?
- 如何隐藏DATAGRID中的某列?
- brinkster现在进不了!
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS0246: 找不到类型或命名空间名称“SQLConnection”(是否缺少 using 指令或程序集引用?)源错误:
行 5: string mySelectQuery = "SELECT * from Company";
行 6: string myConnString="server=localhost;uid=sa;pwd=;database=search";
行 7: SQLConnection myConnection = new SQLConnection(myConnString);
行 8: SQLCommand myCommand = new SQLCommand(mySelectQuery,myConnection);
行 9: myConnection.Open();
string str_Query = "SELECT * from Company";
string str_Conn="server=localhost;uid=sa;pwd=;database=search";
SQLConnection myConnection = new SQLConnection(str_Conn);
SQLCommand myCommand = new SQLCommand(str_Query,str_Conn);
myConnection.Open();
%>
你怎么这样写呢?
《
<script language="c#" runat=server>
string str_Query = "SELECT * from Company";
string str_Conn="server=localhost;uid=sa;pwd=;database=search";
SQLConnection myConnection = new SQLConnection(str_Conn);
SQLCommand myCommand = new SQLCommand(str_Query,str_Conn);
myConnection.Open();
</script>