T
tshad
I am getting the following error which makes no sense. I am doing this in
asp.net. I get the following error:
No accessible overloaded
If you look at the error, there is one overloaded function that can be
called (int, string, int, int).
The first variable is constant that should work fine as an int and works
everywhere else.
The second variable is a string.
The third variable is a System.Int32. (from trace)
The fourth variable is a System.Int64. (from trace)
The code:
******************************************************
trace.warn("type = User - " & Session("User").UserID.GetType.ToString())
trace.warn("type = ApplicantID - " &
Session("ApplicantID").GetType.ToString())
HistoryLog.WriteHistoryLog(13,"Application Filed for: " &
HeaderJobTitle.Text,Session("User").UserID,session("ApplicantID"))
************************************************************
Trace results:
**************************
type = User - System.Int32
type = ApplicantID - System.Int64
****************************
It turns out if I change the above code to:
HistoryLog.WriteHistoryLog(13,"Application Filed for: " &
HeaderJobTitle.Text,Session("User").UserID,Convert.ToInt32(session("ApplicantID")))
I thought that the different sizes of integers were interchangeable
(obviously the conversion works OK). I would have thought that an Int64
would work fine for an Integer field.
The error messages:
********************************************************
Unhandled Execution Error
No accessible overloaded 'HistoryLog.WriteHistoryLog' can be called with
these arguments without a narrowing conversion:
Public Sub WriteHistoryLog ( ByVal historyActionID As Integer, ByVal detail
As String, ByVal userID As Integer, ByVal applicantID As Integer )
Public Sub WriteHistoryLog ( ByVal historyActionID As Integer, ByVal detail
As String, ByVal firstName As String, ByVal lastName As String )
at
Microsoft.VisualBasic.CompilerServices.VBBinder.set_InternalThrow(Exception
Value)
at Microsoft.VisualBasic.CompilerServices.VBBinder.BindToMethod(BindingFlags
bindingAttr, MethodBase[] match, Object[]& args, ParameterModifier[]
modifiers, CultureInfo culture, String[] names, Object& ObjState)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name,
BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target,
Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at ASP.applicationCompletedView_aspx.SubmitIt_Click(Object s,
ImageClickEventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\applicationCompletedView.aspx:line
666
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain()
*******************************************************************
Here is the Function Call that is being called
Public Shared sub WriteHistoryLog (historyActionID as Integer,detail as
String,userID as Integer,applicantID as Integer)
Why doesn't this work with the convert function?
Thanks,
Tom
asp.net. I get the following error:
No accessible overloaded
If you look at the error, there is one overloaded function that can be
called (int, string, int, int).
The first variable is constant that should work fine as an int and works
everywhere else.
The second variable is a string.
The third variable is a System.Int32. (from trace)
The fourth variable is a System.Int64. (from trace)
The code:
******************************************************
trace.warn("type = User - " & Session("User").UserID.GetType.ToString())
trace.warn("type = ApplicantID - " &
Session("ApplicantID").GetType.ToString())
HistoryLog.WriteHistoryLog(13,"Application Filed for: " &
HeaderJobTitle.Text,Session("User").UserID,session("ApplicantID"))
************************************************************
Trace results:
**************************
type = User - System.Int32
type = ApplicantID - System.Int64
****************************
It turns out if I change the above code to:
HistoryLog.WriteHistoryLog(13,"Application Filed for: " &
HeaderJobTitle.Text,Session("User").UserID,Convert.ToInt32(session("ApplicantID")))
I thought that the different sizes of integers were interchangeable
(obviously the conversion works OK). I would have thought that an Int64
would work fine for an Integer field.
The error messages:
********************************************************
Unhandled Execution Error
No accessible overloaded 'HistoryLog.WriteHistoryLog' can be called with
these arguments without a narrowing conversion:
Public Sub WriteHistoryLog ( ByVal historyActionID As Integer, ByVal detail
As String, ByVal userID As Integer, ByVal applicantID As Integer )
Public Sub WriteHistoryLog ( ByVal historyActionID As Integer, ByVal detail
As String, ByVal firstName As String, ByVal lastName As String )
at
Microsoft.VisualBasic.CompilerServices.VBBinder.set_InternalThrow(Exception
Value)
at Microsoft.VisualBasic.CompilerServices.VBBinder.BindToMethod(BindingFlags
bindingAttr, MethodBase[] match, Object[]& args, ParameterModifier[]
modifiers, CultureInfo culture, String[] names, Object& ObjState)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name,
BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target,
Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at ASP.applicationCompletedView_aspx.SubmitIt_Click(Object s,
ImageClickEventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\applicationCompletedView.aspx:line
666
at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
at
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain()
*******************************************************************
Here is the Function Call that is being called
Public Shared sub WriteHistoryLog (historyActionID as Integer,detail as
String,userID as Integer,applicantID as Integer)
Why doesn't this work with the convert function?
Thanks,
Tom