帮我看看这个错误提示什么意思啊???到底哪里错了?
///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