Is there any way to make sure an Insert Command happens before the Page_Load Events?
I'm having a problem with inserting, then reading the DataSet directly after. It seems it processes too quickly, or prior to the record being inserted.
It has an impact on the DataSet that is to be displayed on screen.
Page_Loads > Finds Saved Data > If None exists (string contains 2 types of matches) > Displays the 1 of 2 types randomly.
Buttons 1 & 2 Insert their respective options > Page Posts Back > Page_Loads > Read Saved Data > If my Max amount of the 1 of 2 types of Data are reached, the remaining type is shown > Displayed on page
The problem I am having is that my DisplayDataSet is not getting the correct values. It seems it's always 1 record behind on the count, because the count happens so fast, it's not getting the record that was just inserted.
How can I write this, or make sure the "Find Saved Data' Routine happens after the Insert has been preformed?
Partial Public Class Assessment1
Protected Sub btnINS1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnINS1.Click
Dim connetionString As String
Dim connection As SqlConnection
Dim adapter As New SqlDataAdapter
View Complete Post