Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

FindByText in Dropdown list not Working

$
0
0

This is my Code and any ideas would be appreciated

if ((objRdr["RSurvey4"] != DBNull.Value))

            {

               

string  VarRSurvey4  = (string)objRdr["RSurvey4"].ToString();

                RSurvey4.Items.FindByText(VarRSurvey4).Selected =true;

}

 

This is the Error

 

Object reference not set to an instance of an object.              Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.            
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:

Line 130:            {
Line 131:                string  VarRSurvey4  = (string)objRdr["RSurvey4"].ToString();Line 132: RSurvey4.Items.FindByText(VarRSurvey4).Selected = true; Line 133:                
Line 134:              //  RSurvey4.Items.FindByText((string)objRdr["RSurvey4"]);
                  

Source File:c:\inetpub\vhosts\risktechipra.com.au\httpdocs\inspectionsAdd.aspx   Line:132            


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>