私はASP.NET 3.5を使用しています。私は、ユーザーがボタンをクリックすると、そのページ上に情報がある別のページを描くことになっているというフォームを作った。System.NotImplementedExceptionエラー
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
私は助けのための十分な情報を与えるためにここに投稿する必要があるだろうか、すべてはよく分からない。その代わりロードの私は、このエラーページを取得します。
エラーが発生する可能性があるコードを次に示します。このエラーは、あなたがロードしているページがロード・プロセス中にそのコードによってアクセスされるGetPersonnelメソッドを実装していないことを意味
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();
}
}
GetPersonnelメソッドを実装しましたか?スタブは、実際にメソッドを実装するまで、デフォルトでNotImplementedExceptionをスローします。 – Brandon