• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Values assignin to text boxes through coding not saving in database


I am using VB.net.  Through coding I bound textboxes and datagrid to dataset columns.  I am not using controls for dataadapter, dataset and connection.  through coding I am assignin some values to some text boxes.  and in some text boxes user will input the values.  During the save, I found values which assigned to text boxes through coding is not saved in database.  After assgining values to text boxes if I am clicking that text boxes values are saved in databse.  Why it is happening like this ? what is solution for this problems??

Please Help

2 Solutions
Make sure you assign your Value while IsPagePostBack is false....


Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
 If Not IsPostBack Then
     ' Fill your textbox here...
 End If
End Sub


Otherwise the values will be replaced by the time you hit Submit/Save.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now