Results 1 to 2 of 2

Thread: Select statement then show the data in textbox.

  1. #1
    Junior Member
    Join Date
    Jul 12
    Posts
    21

    Select statement then show the data in textbox.

    Can you guys please tell me whats wrong on my code. Im trying to get the data of Title, Author, Price, Stock from DB and output it on my textboxes.

    Code:
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    
            connstring = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Csrp2_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
            conn.ConnectionString = connstring
    
    
    
            If TextBox6.Text = form1.TextBox6.Text Then
                sql = "SELECT from Csrp2_table1 (Title, Author, Price, Stock) Values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "')"
    
                MsgBox("BZZ")
            Else
                MsgBox("FAILs")
            End If
    
    
            Dim da As New SqlDataAdapter(sql, conn)
    
            conn.Open()
            da.Fill(ds)
            conn.Close()
        End Sub

    Or do you guys think im missing this code
    Code:
    " WHERE RFID = '" textbox6.text " ' "
    but where should i put it???

  2. #2
    Junior Member
    Join Date
    Jul 12
    Posts
    21

    Re: Select statement then show the data in textbox.

    sorry double post :3
    Last edited by Sythez; Aug 17th, 2012 at 08:04 PM. Reason: Sorry double post :3

Posting Permissions

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