System.NotImplementedException错误

Mik*_*ike 5 c#

我正在使用ASP.NET 3.5.我做了一个表单,当用户点击一个按钮时,它应该在另一个页面上添加有关它的信息.而不是加载我得到这个错误页面:

The method or operation is not implemented. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NotImplementedException: The method or operation is not implemented.

Source Error: 

    public static dsPersonnel GetPersonnel(string p)
    {
       throw new NotImplementedException();
    } 

Source File:    Line: 203 
Run Code Online (Sandbox Code Playgroud)

我不确定我需要在这里发布什么才能提供足够的帮助信息.

这是错误可能出现的代码.我想我可能有一些不合适的地方:

    public clsDataLayer()
    {

    }

    // This function gets the user activity from the tblPersonnel
    public static dsPersonnel GetPersonnel(string Database, string strSearch)
    {
        dsPersonnel DS;
        OleDbConnection sqlConn;
        OleDbDataAdapter sqlDA;

        //create the connection string 
        sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" +
        "Data Source=" + Database);

        string query;
        if (strSearch == "" || strSearch.Trim().Length == 0)
        {
            query = "SELECT * from tblPersonnel";
        }
        else
        {
            query = "select * from tblPersonnel where LastName = '" + strSearch + "'";
        }


        // Defines sqlDA and what each will consist of
        sqlDA = new OleDbDataAdapter("select * from tblPersonnel", sqlConn);

        // Defines DS and what each will consist of
        DS = new dsPersonnel();

        // Outputs the results from the information gathered
        sqlDA.Fill(DS.tblPersonnel);

        // Starts over for a new user
        return DS;
    }

    // This function saves the user activity
    public static void SavePersonnel(string Database, string FormAccessed)
    {
        // Defines the connection to the database
        OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" +
            "Data Source=" + Database);
        conn.Open();
        OleDbCommand command = conn.CreateCommand();
        string strSQL;

        strSQL = "Insert into tblPersonnel (UserIP, FormAccessed) values ('" +
            GetIP4Address() + "', '" + FormAccessed + "')";

        command.CommandType = CommandType.Text;
        command.CommandText = strSQL;
        command.ExecuteNonQuery();
        conn.Close();

    }

    public static dsPersonnel GetPersonnel(string p)
    {
        throw new NotImplementedException();
    }
}
Run Code Online (Sandbox Code Playgroud)

Tej*_*ejs 13

您正在调用的特定方法(考虑它不是类库方法)很可能是专门执行此操作:

 throw new NotImplementedException();
Run Code Online (Sandbox Code Playgroud)

这是一个存根.这是您的解决方案中的代码; 所以在你的页面上,你的方法可能没有实现.