Adding data to database ( gridview ) , refresh gridview to see the values?

Daphne1905

New Member
I have a gridview.
  • I'm adding values with parameters->open connection->executereader->connection close
But the problem is that the values added are not displayed in the gridview and if I reload the page I still can't see them but if I click on the url textbox in the browser and press enter then I see the values added + 2/3 times the same values in other rows ( because of reload ).\[code\]string cstring = "connection string";string query = "Insert into table (Name) values (@Name)"; Sql conection conect = new sqlconnection(cstring); sqlcommand command = new sqlcommand(query,conect) ; command.parameters.addwithvalue("Name",name.text); conect.open(); comanda.executeReader(); conect.close\[/code\]
 
Back
Top