Value cannot be null:parameter name key

Posted by Kshah under ASP.NET on 8/1/2011 | Points: 10 | Views : 7109 | Status : [Member] | Replies : 4
Hello
I encountered this issue when i am binding a gridview a datatable.
It shows me a error as Value cannot be null:Parameter name key.

Thanks & Regards,
Komal Shah




Responses

Posted by: SheoNarayan on: 8/1/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi KShah,

You have provided very less information, however based on this I can assume that your datasource having some column as null that is stopping it to bind the data. Can you provide little more information like the code of the gridview and what kind of data you are trying to bind?

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Kshah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 8/1/2011 [Member] Starter | Points: 25

Up
0
Down
hi Kshah,

if you are assigning a value to your variable that comes from the gridview row value, check first if the row value is not null. If it is not null then set your variable with the gridview row value else set your variable to nothing.



Kshah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 8/2/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi komal,

it means either there is less column in ur table then u wrote in gridview or any spelling mistake is there in column name

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Kshah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 8/3/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

Just check if your column name assigned to the grid and the column name that you are binding are same, if there is any mismatch you will be getting this type of error.


Thanks and Regards
Madhu

Kshah, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response