PDA

View Full Version : سوال: این eror چیه ؟؟؟ throw new NotImplementedException();



mustafaehsani
جمعه 31 مرداد 1393, 22:54 عصر
این eror چیه ؟؟؟


throw new NotImplementedException();

mustafaehsani
شنبه 01 شهریور 1393, 00:35 صبح
Server Error in '/' Application.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:



Line 236: public void insert_sbc(string StIID, int SelCID)
Line 237: {
Line 238: throw new NotImplementedException();
Line 239: }
Line 240:}



Source File: c:\Users\mustafa\Documents\Visual Studio 2013\WebSites\sbc final\App_Code\DataClasses.designer.cs Line: 238

Stack Trace:



[NotImplementedException: The method or operation is not implemented.]
DataClassesDataContext.insert_sbc(String StIID, Int32 SelCID) in c:\Users\mustafa\Documents\Visual Studio 2013\WebSites\sbc final\App_Code\DataClasses.designer.cs:238
HesabdariBazarganiKardani.btn_insert_Click(Object sender, EventArgs e) in c:\Users\mustafa\Documents\Visual Studio 2013\WebSites\sbc final\HesabdariBazarganiKardani.aspx.cs:55
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615682
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

En_MK
شنبه 01 شهریور 1393, 03:53 صبح
من اینجا (http://stackoverflow.com/questions/10193284/what-does-throw-new-notimplementedexception-do-exactly) توضیحات را خوندم+مثال
انگار زمانهایی که نمیخوایم متدی را پیاده سازی کنیم ولی متد مقداری را بر میگردونه برای اینه run time ارور نده این throw را می نویسم

private int Add(int x, int y)
}

{



.and have no code inside to do such (the method doesn't even return an integer). This is what NotImplementedException is used for.