G
Guest
Hello All,
I have a question related to performance and/or best practice.
Whenever I try to access a column's value from the dataset I use the
following convention.
if(objData.Tables[0].Rows[0]["FIELD_ID"].ToString()!="")
LINE 1
{
strLength = objData.Tables[0].Rows[0]["FIELD_ID"].ToString(); LINE 3
}
In the above code, in LINE 1 I am checking if that column is empty or not
and if it is not empty then I am assiging it to another variable by accessing
the column from dataset in LINE3
Can I optimize my code further. Am I coding the right way? I feel that
accessing the dataset object twice somehow is an expensive and redundant
operation.
Any pointers?
Thanks!!
I have a question related to performance and/or best practice.
Whenever I try to access a column's value from the dataset I use the
following convention.
if(objData.Tables[0].Rows[0]["FIELD_ID"].ToString()!="")
LINE 1
{
strLength = objData.Tables[0].Rows[0]["FIELD_ID"].ToString(); LINE 3
}
In the above code, in LINE 1 I am checking if that column is empty or not
and if it is not empty then I am assiging it to another variable by accessing
the column from dataset in LINE3
Can I optimize my code further. Am I coding the right way? I feel that
accessing the dataset object twice somehow is an expensive and redundant
operation.
Any pointers?
Thanks!!