帮我看看这个错误提示什么意思啊???到底哪里错了?

blackangel blackangel 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
///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
...全文
评论 3
收藏 已收藏
分享
返回顶部
blackangel
C# 111,129 成员 642,540 内容