c# - asp.net database data retained after table deleted -


i trying develop webpage based on data in database. able working code copied website. 1 line of data. when added several lines , tested again, still displayed 1 line. when deleted table , recreated another, same 1 line still being displayed, no matter seems. i've restarted pc , checked ms sql management studio , attached .mdf database looks ok. here's code:

protected void page_load(object sender, eventargs e)     {         sqlconnection scon = new sqlconnection("data source = .\\sqlexpress; attachdbfilename=f:\\workstation_main\\webprojects\\qura\\2015-06-11_asp\\qura_a08\\app_data\\populatedb.mdf; integrated security = true; initial catalog = populatetable; user instance=true; multipleactiveresultsets=true");          stringbuilder htmlstring = new stringbuilder();          if (!ispostback)         {             using (sqlcommand scmd = new sqlcommand())             {                 scmd.connection = scon;                 scmd.commandtype = commandtype.text;                 scmd.commandtext = "select * populatetable";                 scon.open();                 sqldatareader datareader = scmd.executereader();                   if (datareader.hasrows)                 {                      while (datareader.read())                     {                                              htmlstring.append(datareader["datetime"]);                                                htmlstring.append(datareader["statistics"]);                                            }                                        populateplaceholder.controls.add(new literal { text = htmlstring.tostring() });                                       datareader.close();                     datareader.dispose();                 }                            }         }     } 

i appreciate if can tell me needs done. in advance.

i suspect database adding data not same database program reading from.

to test theory, delete rows in table , run web site see if still displays single row.

hope helps


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -