
July 31st, 2009, 06:11 AM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 1
Time spent in forums: 1 h 11 m
Reputation Power: 0
|
|
|
My thesis (Online Billing and Reservation System)
Hello to everyone, i'm just new here in this forum
I have problems with the SQLdatabase, i just wanted to make the inputted data on alternate email textbox show on the same textbox after pressing the submit button and will also save on the database, but this always appear after i pressed the submit button
here is the image
http://img33.imageshack.us/img33/7879/problem1e.jpg
IMAGE PROBLEM 1
URL
I already used if IsDBNull but still not working.
http://img24.imageshack.us/img24/3496/help1oyh.jpg
The Whole Image Problem
URL
Code:
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions
Partial Class html_Default
Inherits System.Web.UI.Page
Public con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Thesis\App _Data\JPDatabase.mdf;Integrated Security=True;User Instance=True")
Function EmailAddressCheck(ByVal emailAddress As String) As Boolean
Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
If emailAddressMatch.Success Then
EmailAddressCheck = True
Else
EmailAddressCheck = False
End If
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con.Open()
Dim c As String
c = "Select * from register where email = '" & Session("email") & "'"
Dim com As New SqlCommand(c, con)
Dim dr As SqlDataReader
dr = com.ExecuteReader
If dr.HasRows Then
dr.Read()
Label1.Text = dr("title")
Label2.Text = dr("fname")
Label3.Text = dr("surname")
Label4.Text = dr("email")
DropDownList1.SelectedItem.Text = dr("title")
TextBox1.Text = dr("surname")
TextBox2.Text = dr("fname")
TextBox3.Text = dr("email")
TextBox4.Text = dr("alemail")
End If
con.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
Dim a As String
a = "Update register set mbirth = '" & DropDownList2.Text & "', dbirth = '" & TextBox12.Text & "', ybirth = '" & TextBox13.Text & "',gender = '" & DropDownList3.Text & "',alphone = '" & TextBox11.Text & "',phone = '" & TextBox10.Text & "',postal= '" & TextBox9.Text & "',state = '" & TextBox8.Text & "',country = '" & TextBox7.Text & "', city = '" & TextBox6.Text & "', mailadd = '" & TextBox5.Text & "', mailtype = '" & DropDownList6.Text & "', title = '" & DropDownList1.Text & "' , alemail = '" & TextBox4.Text & "' where email = '" & Session("email") & "'"
Dim com As New SqlCommand(a, con)
com.ExecuteNonQuery()
Response.Redirect("customerpersonal.aspx")
con.Close()
End Sub
End Class
if you did not understand what i said, please tell me, i will try to explain it much clearer.
|