ERROR - No data exists for the row/column, Help Plz


when try execute code, displays error message "no data exists row/column"

my code :

private void combobox6_selectedindexchanged(object sender, eventargs e)
        {
            string connstring = "provider=microsoft.jet.oledb.4.0;data source=d:\\project management application\\database.mdb";

            try
            {
                oledbconnection conncmb = new oledbconnection(connstring);
                conncmb.open();

                string s1 = combobox1.selectedtext.tostring();

                string str1 = "select * data title = '" + s1 + "'";
                oledbcommand cmd1 = new oledbcommand(str1, conncmb);
                oledbdatareader dr1 = cmd1.executereader();
                dr1.read();

                textbox9.text = dr1[1].tostring();


                dr1.close();

                conncmb.close();

            }
            catch (exception ex)
            {
                messagebox.show(ex.message.tostring(), "error", messageboxbuttons.ok, messageboxicon.error);
            }
        }

i have table "data" in database named database.mdb, 2 records present still shows error.

  string str1 = "select * data";

  while(dr1.read())

{
                textbox9.text = dr1[1].tostring();

}

try query ...
if exception not thrown know whats happening .


peter koueik



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

  1. I feel SQL and various other aspects and related tools can easily help people watch out for solutions and make necessary changes in the lines of code.

    SQL Server Load Rest API

    ReplyDelete

Post a Comment

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user