Click here to Skip to main content
14,695,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i tried to solve but i stuck in this using dynamic in my project.
while clicking the record to edit am getting this error..
here is my code in getDynamicData

for (int i = 0; i < gListDynamicControls.Count; i++)
            DynaControlsPL objDFPropTemp = (DynaControlsPL)gListDynamicControls[i];

            if (dsCategoryMasterData.Tables[0].Rows.Count > 0)

                if (!dsCategoryMasterData.Tables[0].Rows[0].IsNull(objDFPropTemp.dfFieldName))//in this line am getting error
                    objDFPropTemp.dfFieldValue = dsCategoryMasterData.Tables[0].Rows[0][objDFPropTemp.dfFieldName];
                    objDFPropTemp.dfFieldValue = null;

can any one suggest me ,.
Updated 5-Jun-12 0:03am
Zoltán Zörgő 5-Jun-12 5:06am
And you are sure that it belongs to the table? List (or watch) all the fields at that point and check it. By the way there is few information in your code about the object types - it is hard to guess.
ythisbug 5-Jun-12 5:21am
thanks zoltan
in my project am saving additional tab records to one table and grid records to another table so am getting error??is it??
Zoltán Zörgő 5-Jun-12 5:39am
I don't really got your point.
What is objDFPropTemp object exactly? I have googled for dfFieldValue and found nothing. Debug it and see if you really have that string (not the filed, it's name!) in the other table exactly as it is.
ythisbug 6-Jun-12 2:26am
am calling class
DynaControlsPL objDFPropTemp = (DynaControlsPL)gListDynamicControls[i];

check objDFPropTemp.dfFieldName value is same as the, one of the column value in dsCategoryMasterData.Tables[0] table.
This means that the column objDFPropTemp.dfFieldName is not part of the table. Check in debugger if this column really belongs to the table?
Could be a typo in the variable name and actual columne name.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900