Sub UpdateNewEmailAndPassword(ByVal sEmail As String, ByVal sPassword As String) '// define a connection to the database Dim cs As String = ConfigurationManager.ConnectionStrings("WhatEverNameYouWant").ConnectionString cs = cs.Replace("App_Data\GC.accdb", Server.MapPath("App_Data\GC.accdb")) Dim cn As New OleDbConnection(cs) Try Dim sSQL As String sSQL = "UPDATE MyUsers SET Password = '" & sPassword & "' WHERE Email = '" & sEmail & "'" 'sSQL = "INSERT INTO MyUsers ( [Email], [Password], [FirstName], [Logins] ) SELECT '" & sEmail & "' AS Expr1, '" & sPassword & "' AS Expr2, '" & sFirstName & "' AS Expr3, '" & "First login " & CStr(System.DateTime.Today) & " Subsequent logins " & "'" '// define the sql statement to execute Dim cmd As New OleDbCommand(sSQL, cn) ' '// open the connection cn.Open() cmd.ExecuteNonQuery() Catch ex As Exception Response.Write(ex.Message) Finally If cn.State <> ConnectionState.Closed Then cn.Close() End If End Try End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE