帮我看看这个错误提示什么意思啊???到底哪里错了?
///conn.cs///
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
/// <summary>
/// Summary description for conn
/// </summary>
public class FW:UserControl
{
public SqlConnection objConnection;
public SqlCommand FW(string strSQL)
{
string connectionString = ConfigurationSettings.AppSettings["SqlConStr"];
objConnection = new SqlConnection(connectionString);
SqlCommand objCommand = new SqlCommand(strSQL, objConnection);
objConnection.Open();
return objCommand;
}
public void Close()
{
objConnection.Close();
}
}
-----------------------------------------------------------------
///webconfig.ascx///
<%@ Control Language="C#" Inherits="FW" Src="conn.cs"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.SqlClient"%>
<script runat="server">
string strSQL = "select * from shop_config";
SqlCommand objCommand = FW(strSQL);
....
</script>
错误提示:
'FW': member names cannot be the same as their enclosing type
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
/// <summary>
/// Summary description for conn
/// </summary>
public class FW:UserControl
{
public SqlConnection objConnection;
public SqlCommand FW(string strSQL)
{
string connectionString = ConfigurationSettings.AppSettings["SqlConStr"];
objConnection = new SqlConnection(connectionString);
SqlCommand objCommand = new SqlCommand(strSQL, objConnection);
objConnection.Open();
return objCommand;
}
public void Close()
{
objConnection.Close();
}
}
-----------------------------------------------------------------
///webconfig.ascx///
<%@ Control Language="C#" Inherits="FW" Src="conn.cs"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.SqlClient"%>
<script runat="server">
string strSQL = "select * from shop_config";
SqlCommand objCommand = FW(strSQL);
....
</script>
错误提示:
'FW': member names cannot be the same as their enclosing type
...全文
相关推荐
电脑出现NSIS Error错误提示的解决方法.docx
电脑出现NSIS Error错误提示的解决方法.docx
C语言常见错误提示信息
C语言常见提示信息,对C语言编程时出现的错误的解释
cpp-didyoumean你是什么意思根据属性提供良好的错误提示
did you mean-"你是什么意思?" 根据属性提供良好的错误提示
HTTP 500错误是什么意思?
HTTP 500错误是什么意思?
可捕捉的 Microsoft Jet 错误,access错误代号,access错误代号意思一览表
可捕捉的 Microsoft Jet 错误,access错误代号,access错误代号意思一览表 chm格式,语言为中文


