ASP .Net DataList Strange Errors

I am using ASP .Net's DataLIst control for Data binding in one of my projects. Everything was working fine. In the item command event, I was using value of text from a label which is databound to a primary key (datatype float). But it was rounding off the float value to 13 decimal places when storing as Text of Label. So I could not use it anymore as a primary key for the row which is represented by the current item.

Then I switched to the dataKeys collection of DataList and it was working fine because DataKeys also storss the whole set of primary key values of the current dataset/datatable. But suddenly it started storing DBNull instead of the primary key value in some specific kinds of records, not all of them. I tried it amny times but nothing worked. Naturally I had to switch towards the Text property of Label for those specific Items. 

No comments:

LinkWithin

Related Posts with Thumbnails