.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

The best overloaded method match for... has some invalid arguments

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
I have a compilation error generated by this scenario: i have : 1. DataAccessLayses 2. Entity 3. PresentationLayer(web application)4. BankServices(web service) inside the webservice i have one web method with argument of my pre-defined class library it name is CustomerEL and the class in PresentationLayer calling the webservice method ,CustomerEL cusE = new CustomerEL();objsv.addCustomer(cusE);(addCustomer(<argument>) is method in BankServices)  and here the eror occuredcan you help me !Regards

View Complete Post

More Related Resource Links

CS1502: The best overloaded method match for 'System.Web.UI.WebControls.TableCellCollection.this[in


 Argh... I'm learning how to utilize my codebehind for more, and am stuck trying to figure out who to get to the labels that are in a gridview from my codebehind, and keep getting this error... 


in my .aspx, I have this as part of my gridview 

<asp:Label ID="lblSubSectionName" runat="server" Text='<%# Bind("SubSectionName") %>'></asp:Label>
and, here's my code behind that I thought would get this label..


[MVC 3 Beta] The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(S



I'm trying to use the Zippy helper (http://www.weirdlover.com/2010/05/

10/zcontroller-asp-net-mvc-controller-fo-your-scripts-styles-images/) to compress, cache, and unify my javascripts and stylesheets with MVC 3 beta (using Razor engine) but on this line:
I always have this error:
Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments

can you help me?

arguments null in onSuccess method

HiI'm trying to validate user input into a textbox via a web service.I'm using a Dynamic Data site, with a custom Dynamic Data field to show this particular value. In the dynamic data field I've added a custom validator - <asp:CustomValidator id="CustomValidator1" runat="server"        ErrorMessage="Invalid Item ID!"      ControlToValidate="TextBox1"      OnServerValidate="ServerValidate"      ClientValidationFunction="validateItem"     /><asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage="Invalid Item ID!" ControlToValidate="TextBox1" OnServerValidate="ServerValidate" ClientValidationFunction="validateItem" />In a custom page, I have the following Javascript - <script type="text/javascript"> <!-- function validateItem(source, arguments) { InventTableService.exists(arguments.Value, onComplete, onError); } function onComplete(source, arguments) { alert(source); arguments.IsValid = source; }

No overload for method 'Delete' takes 3 arguments



[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
     public bool DeleteProduct(int original_ID, string original_Priimek)


    Guid original_UserId = Guid.NewGuid();

    int rowsAffected = Adapter.Delete(original_ID, original_UserId, original_Priimek);

   // Return true if precisely one row was deleted, otherwise false
   return rowsAffected == 1;

string original_Priimek - not found

Please help

linq to sql - has some invalid arguments



I created a dbml fiile and tried it if it works or not. but the sp function is crashing. here is the error;

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS1502: The best overloaded method match for ',MyDataContext.CustomerDetails_InsertWhilePurchase(ref int?, string, string, string, string, System.DateTime?, string, string, string, string, string, string)' has some invalid arguments

Source Error:

Line 8:      public void ProcessRequest (HttpContext context) {
Line 9:          MyDataContext newm = new MyDataContext();
Line 10:         newm.CustomerDetails_InsertWhilePurchase(null

Web service's method GetListItems fails with error "'_', hexadecimal value 0x0B, is an invalid ch


We are developing ASP.NET web application that interacts with SharePoint via web services. At some our customers' systems we encountered the following problem.
Web method GetListItems throws an exception :
 ' ', hexadecimal value 0x0B, is an invalid character. Line 42, position 31.

Stack trace of exception you can see below:
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ITSMS.DAL.SPLists.Lists.GetListItems(String listName, String viewName, XmlNode query, XmlNode viewFields, String rowLimit, XmlNode queryOptions, String webID)

INNER MESSAGE: ' ', hexadecimal value 0x0B, is an invalid character. Line 42, position 31.

   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(St

On clicking a button, call a method with extra arguments


I have a small question about Button.Click events, namely how can I call a method with some extra arguments?

My code is this:

btn.Click += new RoutedEventHandler(Method);

But I would really like it to be of the following form:

btn.Click += new RoutedEventHandler(Method(x));

That is, having an extra argument. However, this does not work.

How can I create something that has the desired operation?

How to marshal safearray arguments when calling managed C# method from unmanaged C++?


I'm trying to utilize an old application framework from managed C# code but I don't understand how to marshal the safearray argument which is forwarded to the managed code. Here is a code snipped describing how the managed code is called:

  try {
    _ObjectHandlePtr pObjectHandle; 
    _ObjectPtr pObject; 
    _TypePtr pType;
    SAFEARRAY* psa;

    // Create an instance of a type from an assembly
    pObjectHandle = pDefaultDomain->CreateInstanceFrom(L"ClassLibrary1.dll",   // no path -- local directory
    variant_t vtobj = pObjectHandle->Unwrap();                   // Get an _Object (as variant) from the _ObjectHandle
    vtobj.pdispVal->QueryInterface(__uuidof(_Object),(void**)&pObject); // QI the variant for the Object iface
    pType = pObject->GetType();                             // Get the _Type iface
    psa = SafeArrayCreateVector(VT_VARIANT,0,1);               // Create 

Compiler Error Message: CS1501: No overload for method 'EndExecuteNonQuery' takes '0' arguments



I have a page that add and edit news. and 2 class file


public class PageDataAccess:Page
    protected DataAccess DA=new DataAccess();

    protected void Page_UnLoad(object sender, EventArgs e)


public class DataAccess
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MisrNewsConn"].ToString());
    public DataAccess()
		// TODO: Add constructor logic here
    public void DataClose()
    public int addEditNews(string Nid,string title, string summary, string detail, string cid, bool Ishome, bool IsMain, byte[] image)
        SqlCommand cmd = new SqlCommand("StoredProcedure1", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@IsMain", IsMain);

The security accessibility of the overriding method must match the security accessibility of the met




I am faced with the infamous exception "Inheritance security rules violated while overriding member : Security accessibility of the overriding method must match the security accessibility of the method being overriden" exception in my project. I think I understand security transparency level 2 and when this message is supposed to occur, and what is necessary to fix the problem. However, as far as I know, the problem should not occur here because the security attributes of the overriden method does match the ones from the base method.



Indeed, I have a class inheriting MarshalByRefObject and overriding InitializeLifetimeService. This is the method triggering the exception but it is correctly annotated with the SecurityCriticalAttribute to match the base method's security accessibility.

public abstract class DisposableMarshalByRefObject : MarshalByRefObject, IDisposable 
   public override object InitializeLifetimeService() 
     return null;


I have two projects : a class library where DispposableMarshalByRefObject is declared and a console application for testing purposes. The console application i

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

The number of members in the conceptual type ... does not match with the number of members on the ob



I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!

Using CreateNewUserWizard SendingMail method to email me, not applicatnt.


I have staff area of my site I am protecting with forms authentication using c# and .Net 4.0. What I want to do is let the staff members register on the site but instead of the confermation email being sent to them I want it sent to me so I can go in and approve it. I have been trying to use the SendingMail method  but can not figure out how to get it to email me instead of the person that registered. I have searched around this site and find many topics on the SendingMail method but none seem to properly address my issue. Can anyone help me out?

Invalid length for a Base-64 char array for my coding in ASP.net C#. How to solve it ?


Hi Friends ,

I have done encrypted password and decode but i got error  like  this  " Invalid length for a Base-64 char array" .

Pls help . Thanks


psswd = txtPassword.Text;

pwed = base64Decode(psswd);

public string base64Decode(string sData)
            System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
            System.Text.Decoder utf8Decode = encoder.GetDecoder();
            byte[] todecode_byte = Convert.FromBase64String(sData);
            int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
            char[] decoded_char = new char[charCount];
            utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
            string result = new String(decoded_char); return result;

statement cannot appear outside of a method body


hi all,

  i am posting my vb.net problem .plz tell me how to resolve this :-

Dim conn As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString
    'Dim mysqlconnection As New SqlConnection(conn)
    'If mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();
    'Dim mySqlcommand As New SqlCommand("select CategoryId,CategoryName from Categories", mysqlconnection)
    'Dim mySqlDataAdapter As New SqlDataAdapter(mySqlcommand)
    'Dim mydataSet As New DataSet()

    'if mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();

i m getting 5 errors in this code

declaration expected in mySqlDataAdapter.Fill method; Gridview1.DataSource=ds; Gridview1.DataBind();

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend