Jump to content

Recommended Posts

Posted (edited)

Hello Im building a site and I have little knowledge on web forms

Im meking a contact info form so al data they put in, could be foward to my email

while I learn to use Data Base to store info on line.

 

Any help with the form I would appreciate.

 

Thx :rolleyes:

Edited by xagosto
Posted
There are lots of tutorials or existing scripts out there. Just do a web search for "php contact form".

Im not using php, i'm using Visual web desing express edition coding in vb, and using SQL express I got the conneccion I

have 1 errors but the program just says that systax error near Registro. (Don't get where is the problem this is my code.

Any help would be great.

 

Dim registerDatasoures As New SqlDataSource()

 

registerDatasoures.ConnectionString = ConfigurationManager.ConnectionStrings("registroConnectionString1").ToString()

registerDatasoures.InsertCommandType = SqlDataSourceCommandType.Text

registerDatasoures.InsertCommand = "INSERT INTO Registro ( UserID, datetime, Name, Last_Name, Age, City, Phone, Gender, Email, Weight, IP)VALUES ( @UserID, @datetime, @Name, @Last Name, @Age, @City, @Phone, @Gender, @Email, @Weight, @IP) "

 

registerDatasoures.InsertParameters.Add("Name", txtName.Text)

registerDatasoures.InsertParameters.Add("Last_Name", txtLname.Text)

registerDatasoures.InsertParameters.Add("Age", txtAge.Text)

registerDatasoures.InsertParameters.Add("City", txtCity.Text)

registerDatasoures.InsertParameters.Add("Phone", txtPhone.Text)

registerDatasoures.InsertParameters.Add("Gender", txtGender.Text)

registerDatasoures.InsertParameters.Add("Email", txtEmail.Text)

registerDatasoures.InsertParameters.Add("Weight", txtWeight.Text)

registerDatasoures.InsertParameters.Add("IP", Request.UserHostAddress.ToString())

registerDatasoures.InsertParameters.Add("datetime", DateTime.Now())

 

 

Dim datainserted As Integer = 0

 

Try

datainserted = registerDatasoures.Insert()

 

 

Catch ex As Exception

 

Server.Transfer("errorPage.aspx")

 

 

Finally

datainserted = Nothing

 

 

 

End Try

 

If datainserted <> 10 Then

 

Server.Transfer("errorPage.aspx")

Else

Server.Transfer("InfComplete.aspx")

End If

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...