Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
value cannot be null
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sarnam  
View profile  
 More options Apr 26 2012, 6:22 am
From: Sarnam <sarna...@gmail.com>
Date: Thu, 26 Apr 2012 15:52:51 +0530
Local: Thurs, Apr 26 2012 6:22 am
Subject: value cannot be null

Hi,
   I am fetching data from mongodb using mongo C# driver based on some
condition. but application behaving randomly. sometimes it give result or
sometimes it throw an error like "Value can not be null". So can any one
help me to fix this problem.

Thanks
Sarnam Singh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Stam  
View profile  
 More options Apr 26 2012, 9:19 am
From: Robert Stam <rob...@10gen.com>
Date: Thu, 26 Apr 2012 09:19:59 -0400
Local: Thurs, Apr 26 2012 9:19 am
Subject: Re: [mongodb-user] value cannot be null

You didn't give much information, but I'm guessing that you called a method
in the C# driver with a null argument when a null argument is not valid
(hence the error message).

For example, the following will give the same error message you are seeing:

    Query.EQ("x", null);

The correct way to write that is:

    Query.EQ("x", BsonNull.Value);

If you look at the stack trace the top few entries should be methods in the
C# driver but the first method you find that is in your code is where the
error is coming from. If the stack trace has line numbers you'll know
exactly what line number the error is on.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarnam  
View profile  
 More options Apr 26 2012, 10:44 am
From: Sarnam <sarna...@gmail.com>
Date: Thu, 26 Apr 2012 20:14:10 +0530
Local: Thurs, Apr 26 2012 10:44 am
Subject: Re: [mongodb-user] value cannot be null

thanks for reply. but as per my observation the problem is coming due to
load, because i was doing load testing with 20-30 users hitting search
query at the same time then i was running fine but when users more than 30
hitting at same time then this problem is coming and  i am pretty sure
about not passing any null value because i have put if condition like :
 IMongoQuery qry = null;

            if (searchingName.ToLower().Trim() == "id")
                searchingName = "_id";
            int x;
            if (!string.IsNullOrEmpty(searchingValue))
            {
                if (Int32.TryParse(searchingValue, out x) == false ||
searchingName.ToLower().Trim() == "ipaddress")
                {

                    switch (searchingOperator)
                    {

                        case JqGridSearchOperators.Eq:
                            if (!xMLElement.Item1)
                                qry = Query.EQ(searchingName, new
BsonRegularExpression("/^" + searchingValue + "$/i"));
                            else
                                qry = Query.ElemMatch("FieldList",
Query.And( Query.EQ("FieldName", subFieldName), Query.EQ("FieldValue", new
BsonRegularExpression("/^" + searchingValue + "$/i"))));
                            break;
                        case JqGridSearchOperators.Ne:
                            if (!xMLElement.Item1)
                                qry = Query.EQ(searchingName, new
BsonDocument("$not", new BsonRegularExpression("/^" + searchingValue +
"$/i")));
                            else
                                qry = Query.ElemMatch("FieldList",
Query.And(Query.EQ("FieldName", subFieldName), Query.EQ("FieldValue", new
BsonDocument("$not", new BsonRegularExpression("/^" + searchingValue +
"$/i")))));
                            break;
                        case JqGridSearchOperators.Cn:
                            if (!xMLElement.Item1)
                                qry = Query.Matches(searchingName, new
BsonRegularExpression(searchingValue, "i"));
                            else
                                qry = Query.ElemMatch("FieldList",
Query.And(Query.EQ("FieldName", subFieldName), Query.EQ("FieldValue", new
BsonRegularExpression(searchingValue, "i"))));
                            break;
                    }

                }
                else
                {
                    switch (searchingOperator)
                    {
                        case JqGridSearchOperators.Eq:
                            qry = Query.EQ(searchingName,x);
                            break;
                        case JqGridSearchOperators.Ne:
                            qry = Query.NE(searchingName,x);
                            break;
                        case JqGridSearchOperators.Lt:
                            qry = Query.LT(searchingName,x );
                            break;
                        case JqGridSearchOperators.Le:
                            qry = Query.LTE(searchingName,x);
                            break;
                        case JqGridSearchOperators.Gt:
                            qry = Query.GT(searchingName,x);
                            break;
                        case JqGridSearchOperators.Ge:
                            qry = Query.GTE(searchingName,x );
                            break;

                    }
                }
            }

so it would be great help if you can guide me over this issue.

Thanks
Sarnam Singh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Stam  
View profile  
 More options Apr 26 2012, 10:51 am
From: Robert Stam <rob...@10gen.com>
Date: Thu, 26 Apr 2012 10:51:46 -0400
Local: Thurs, Apr 26 2012 10:51 am
Subject: Re: [mongodb-user] value cannot be null

Can you provide the stack trace when you are getting an
ArgumentNullException?

That would help diagnose the issue.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »