this is Visual Studio 2005, asp.NET 2.0
I'm missing something hopefully someone can tell me what it is. When I press the submit button I want to save info. to the db. When I press the submit button the code following this works fine to send a email. but this db part does nothing, no error either. I think I need more statements to execute it or something?
The passowrd and server, etc have been changed to protect the innocent.
DougP
< I Built one
I'm missing something hopefully someone can tell me what it is. When I press the submit button I want to save info. to the db. When I press the submit button the code following this works fine to send a email. but this db part does nothing, no error either. I think I need more statements to execute it or something?
The passowrd and server, etc have been changed to protect the innocent.
Code:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
'If Not Page.IsPostBack Then
Dim CrLf As String = Chr(13) & Chr(10)
'save to database
Try
Dim dt As New Data.DataTable()
Dim myConnection As New Data.SqlClient.SqlConnection("Server=000.000.000.000;Database=myDb;User ID=user;Password=password")
Dim strSQL As String = "Insert into R2D2Events (EventDate, EventStartTime, EventEndTime, EventType, Company, ContactFName, ContactLName, ContactPhone, LocationName, LocationAddr1, LocationAddr2, LocationCity, LocationState, LocationZip, Email, Over18, SpecialInstructions) VALUES (" & Me.txtDateChoosen.Text & ", " & Me.ddlStartTime.Text & ", " & Me.ddlEndTime.Text & ", " & Me.ddlEventType.Text & ", " & Me.txtCompany.Text & ", " & Me.txtContactFName.Text & ", " & Me.txtContactLName.Text & ", " & Me.txtContactPhone.Text & ", " & Me.txtLocation.Text & ", " & Me.txtLocationAddr1.Text & ", " & Me.txtLocationAddr2.Text & ", " & Me.txtLocationCity.Text & ", " & Me.txtLocationState.Text & ", " & Me.txtLocationZip.Text & ", " & Me.txtEmail.Text & ", " & Me.txtSpcialInstructions.Text & ", " & Me.chkIm18yearsold.Text & ")"
Dim myCommand As New Data.SqlClient.SqlCommand(strSQL, myConnection)
Catch ex As Exception
lblErrorStatus.Text = ex.ToString()
End Try
DougP
< I Built one