G
Guest
Hopefully I've got the right discussion group
I'm building using a web app using VS.NET 2002 / SQL 2000
The following should process the details from an online form to a SQL db but when the Submit is pressed, the form looks like it actions, but NOTHING is added to the DB! Am I missing an update statement ?
....I thought the following statement which is in the code below added the details to the DB: " DataSetClientReg1.ClientDetails.Rows.Add(RowNew) " would add the new row in the DB
( dataSetClientReg1 is set to the connection string in the code, which I think is correct.
Code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Clic
'standard dim for adding the form dat
Dim RowNew As DataSetClientReg.ClientDetailsRow = DataSetClientReg1.ClientDetails.NewRo
'additional Dim to get the last entry in the D
Dim intID As Intege
Dim cmdNewRef As New SqlCommand("SELECT MAX(ClientRef) FROM ClientDetails", SqlConnection1
'get MAX value from ClientRe
SqlConnection1.Open(
intID = CInt(cmdNewRef.ExecuteScalar()
intID = intID +
' Adding the data for the form her
RowNew.ClientRef = intI
'Adding the normal form stuf
RowNew.ClientType = "GP
RowNew.ContactTitle = PracticeName.Tex
RowNew.Add1 = Add1.Tex
RowNew.Add2 = Add2.Tex
RowNew.Add3 = Add3.Tex
RowNew.Add4 = Add4.Tex
RowNew.PostCode = PostCode.Tex
RowNew.GPpracticeSize = PracticeSize.Tex
RowNew.GPcompSystem = CompSystem.SelectedInde
RowNew.ContactTitle = Title.SelectedInde
RowNew.ContactFirstName = FirstName.Tex
RowNew.ContactLastName = Surname.Tex
RowNew.Tel = Tel.Tex
RowNew.Fax = Fax.Tex
RowNew.Email = Email.Tex
RowNew.CameAwareofID = AwareofID.SelectedInde
RowNew.CameAwareofIDother = AwareofIDOther.Tex
RowNew.AdditionalInfo = AdditionalInfo.Tex
'Adding the date and make account activ
RowNew.DateRegistered = Date.No
RowNew.Active = "y
'try to commit the update to the D
DataSetClientReg1.ClientDetails.Rows.Add(RowNew
SqlConnection1.Close(
'once committed, goto another pag
Server.Transfer("../LogIn/ClientsLogIn.aspx"
End Sub
I'm building using a web app using VS.NET 2002 / SQL 2000
The following should process the details from an online form to a SQL db but when the Submit is pressed, the form looks like it actions, but NOTHING is added to the DB! Am I missing an update statement ?
....I thought the following statement which is in the code below added the details to the DB: " DataSetClientReg1.ClientDetails.Rows.Add(RowNew) " would add the new row in the DB
( dataSetClientReg1 is set to the connection string in the code, which I think is correct.
Code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Clic
'standard dim for adding the form dat
Dim RowNew As DataSetClientReg.ClientDetailsRow = DataSetClientReg1.ClientDetails.NewRo
'additional Dim to get the last entry in the D
Dim intID As Intege
Dim cmdNewRef As New SqlCommand("SELECT MAX(ClientRef) FROM ClientDetails", SqlConnection1
'get MAX value from ClientRe
SqlConnection1.Open(
intID = CInt(cmdNewRef.ExecuteScalar()
intID = intID +
' Adding the data for the form her
RowNew.ClientRef = intI
'Adding the normal form stuf
RowNew.ClientType = "GP
RowNew.ContactTitle = PracticeName.Tex
RowNew.Add1 = Add1.Tex
RowNew.Add2 = Add2.Tex
RowNew.Add3 = Add3.Tex
RowNew.Add4 = Add4.Tex
RowNew.PostCode = PostCode.Tex
RowNew.GPpracticeSize = PracticeSize.Tex
RowNew.GPcompSystem = CompSystem.SelectedInde
RowNew.ContactTitle = Title.SelectedInde
RowNew.ContactFirstName = FirstName.Tex
RowNew.ContactLastName = Surname.Tex
RowNew.Tel = Tel.Tex
RowNew.Fax = Fax.Tex
RowNew.Email = Email.Tex
RowNew.CameAwareofID = AwareofID.SelectedInde
RowNew.CameAwareofIDother = AwareofIDOther.Tex
RowNew.AdditionalInfo = AdditionalInfo.Tex
'Adding the date and make account activ
RowNew.DateRegistered = Date.No
RowNew.Active = "y
'try to commit the update to the D
DataSetClientReg1.ClientDetails.Rows.Add(RowNew
SqlConnection1.Close(
'once committed, goto another pag
Server.Transfer("../LogIn/ClientsLogIn.aspx"
End Sub