Hi all i am using vb 2005 with an access database 2003 vb.net website (aspx page) i am try to put contact details in to the database with six text boves and one button (Button1) to submit the informaton in run time (aspx page) when i run the page no problems then i click submit no error but it does not send the information to the dadtbase.i put the code when i double click on the button here is my code could you plz tell what i am doing wrong thanks.
HTML Code:Imports System.Data Partial Class accessall_NewCustomer Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim str As String Dim cmd As OleDb.OleDbCommand Dim con As New OleDb.OleDbConnection Try con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Users\michael\Desktop\New Web Site\Motoglass0910new222.mdb" con.Open() str = "insert into CustomerAccountDetails values(" & CInt(SurNametxt.Text) & ",'" & ForeNametxt.Text & ",'" & Addresstxt.Text & ",'" & Towntxt.Text & ",'" & Postcodetxt.Text & "','" & _PhoneNotxt.Text & "')" 'string stores the command and CInt is used to convert number to string cmd = New OleDb.OleDbCommand(str, con) Catch End Try con.Close() End Sub End Class


Reply With Quote
