Results 1 to 8 of 8

Thread: display for current user AND update command

Threaded View

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    display for current user AND update command

    i want the textbox to display to the current user,
    (who has logged in using username and password )


    visual basic code: Dim cmdselect As SqlCommand cmdselect = New SqlCommand("SELECT msg_default from tb_comp_detail ", oSQLConn) txtDefault.Text = cmdselect.ExecuteScalar().ToString()


    can i just put in an sql that says "select msg where current user"
    DOES ANYONE HAVE ANY IDEAS

    i.e. at the minute the txtbox displays the first row in the database
    i want the textbox to display the information for the current user

    also what the problem with this update

    Line 1: Incorrect syntax near '('.

    Line 81: Dim sqlSaveMsg1 As New SqlCommand("update tb_comp_detail (msg_custom1) Values ( txt_msg1.text );", oSQLConn)
    Line 82: oSQLConn.Open()
    Line 83: sqlSaveMsg1.ExecuteNonQuery()
    Line 84: oSQLConn.Close()
    __________________
    __________________
    im a newbie so be nice
    Last edited by d2005; Sep 12th, 2005 at 06:08 AM.
    it works 60% of the time, all the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width