Last post Apr 12, 2012 06:39 AM by mastriy
Apr 07, 2012 12:12 PM|silverlight.shailendra|LINK
public void bindStates()
string address = ConfigurationManager.ConnectionStrings["test1"].ConnectionString;
string allStates= "SELECT * FROM states";
myConnection = new MySqlConnection(address);
MySqlCommand ForStates = new MySqlCommand(allStates,myConnection);
MySqlDataReader readState= ForStates.ExecuteReader();
DDLStates.DataSource = readState;
DDLStates.DataTextField = "statename";
DDLStates.DataValueField = "stateId";
catch (Exception ex)
i call above function on Page_Load() but it showing me "Object reference not set to an instance of an object."
can anybody tell me where i wrote wrong?
Apr 12, 2012 06:39 AM|mastriy|LINK
if i find error Object reference not set to an instance of an object, the easiest way to find out is to debug my project, and trace to control/variable/object which vs said that not set to an instance of an object.