Of course there are more than 3 fields in the table but I only need to
update these 3. It all runs and works without errors but the fields do not
get updated. Any Ideas.........?



Private Sub ButtonUpdateMyHeadline_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ButtonUpdateMyHeadline.Click

        '---------- Get Username from Session ----------
        Dim strUsernameWeb As String
        strUsernameWeb = Session("Username")
        '------------------------------------------------------

        'Open the Connection -------------------------------------
        Dim objConn As SqlConnection
        Dim objConnString As String = "Data Source=localhost;Initial
Catalog=dating;User Id=Pass;Password=pass;"
        objConn = New SqlClient.SqlConnection(objConnString)
        objConn.Open()
        '---------------------------------------------------------

        'Build SQL String --------------------------------------
        Dim strSQLstring As String
        Dim objDataTable As DataTable

        strSQLstring = "UPDATE users Set [p_headline] =  @p_headline,
[P_aboutme] = @P_aboutme, [p_match] = @p_match WHERE [Username] = '" &
strUsernameWeb & "'"
        Response.Write(strSQLstring)

        Dim sqlcmd As SqlCommand = New SqlCommand(strSQLstring, objConn)

        sqlcmd.Parameters.Add("@p_headline", SqlDbType.NVarChar, 255).Value
= p_headline.Text
        sqlcmd.Parameters.Add("@P_aboutme", SqlDbType.NVarChar, 2000).Value
= p_aboutme.Text
        sqlcmd.Parameters.Add("@p_match", SqlDbType.NVarChar, 2000).Value =
p_match.Text

        Try
            objConn.Open()
            sqlcmd.ExecuteNonQuery()
            'Trace.Write("strSQL", strSQLstring)
        Catch exc1 As Exception
            'Trace.Write("bad thing", "very bad", exc1)

        Finally
            'Show Completed Profile
            objConn.Dispose()
        End Try



    End Sub




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to