You must Sign In to post a response.
  • Category: .NET

    Hi to all ,pls give the proper solution of below error message.

    C# STATEMENT: if (sqlquery.GetUpperBound() == 1)

    ERROR MESSAGE: No overload for method 'GetUpperBound' takes '0' arguments
  • #583230
    Getupperbound method taking arguments and you can't supplied here.

    Use it as

    if (sqlquery.GetUpperBound(0) == 1)

    Pankaj Rajput

  • #583248
    GetUpperBound takes a parameter as dimenstion. You need to specify that dimention in your method.

    Please check the following code:

    if (sqlquery.GetUpperBound(0) == 1)

    Thanks & Regards
    Paritosh Mohapatra
    Microsoft MVP (ASP.Net/IIS)
    DotNetSpider MVM

  • #583277
    try this code

    if (sqlquery.GetUpperBound(0) == 1)
    //your code

    hope this will help you

  • #583441
    string[] sqlquery1 = new string[] {"member1", "member2", "member3"};
    int i = sqlquery1.GetUpperBound(0); // this will give 2 as available indexes are 0,1,2

    string[,] sqlquery2 = new string[,] { {"c1", "m1"}, {"c2", "m2"}, {"c3", "m3"}, {"c4", "m4"} };
    int j = sqlquery2.GetUpperBound(0); // this will give 3 as available indexes are 0,1,2,3

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.