I am facing some awkward situation with VB.Net code.
I am having source code of ASP.Net using VB.Net which was written in late 2010.
It has been running fine until 3 days ago.
Below line of code was working till 3 days ago.
Cmd.Parameters("@idnum").Value = e.Item.Cells.Item(2).Text
But I did some changes in code and now above line of code was not working. I checked that System.SQL.Client reference is same and there is windows or .net framework update. I am not sure what happened.
Though I found the solution and here it is
Cmd.Parameters.Item("@idnum").Value = e.Item.Cells.Item(2).Text
But I am keen to learn what could be the possible reason of failure of later code.
EDIT 1: Here is the error if
System.MissingMemberException was unhandled by user code HResult=-2146233070 Message=Overload resolution failed because no accessible 'Parameters' accepts this number of arguments. Source=Microsoft.VisualBasic StackTrace: at Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure, Container BaseReference) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ResolveCall(Container BaseReference, String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at HMGS.Order.grdItems_ItemDataBound(Object sender, DataGridItemEventArgs e) in C:\HMGS Dev Source BioUrja\WebSource\HMGS\HMIOnly\Orders\Order.aspx.vb:line 1937 at System.Web.UI.WebControls.DataGrid.OnItemDataBound(DataGridItemEventArgs e) at System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) at System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.BaseDataList.DataBind() at HMGS.Order.popItems(Object idnum) in C:\HMGS Dev Source BioUrja\WebSource\HMGS\HMIOnly\Orders\Order.aspx.vb:line 1885 at HMGS.Order.popInfo(Object idnum) in C:\HMGS Dev Source BioUrja\WebSource\HMGS\HMIOnly\Orders\Order.aspx.vb:line 841 at HMGS.Order.Page_Load(Object sender, EventArgs e) in C:\HMGS Dev Source BioUrja\WebSource\HMGS\HMIOnly\Orders\Order.aspx.vb:line 75 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: