none
sql database accesing. RRS feed

  • Question

  • Hi,

    i am using visual studio 2003 and sql server 2000

    I have a program that connects to a database.
    the database contains two colums:
    example:
    ProductId-----Name
    1-------------Casino Royale
    2-------------Silent Hill
    3-------------Lady in the Water



    there is a "Form1"
    when i click on a menu item on Form1, an inputbox is displayed asking the user for a productid,
    then,

    what i am trying to achieve here is: according to the productid a correspondent name will be displayed in another "Form2" in a Label.


    how can i do this?


    thanks for any response...


    this is the code i have:

    Code Block

        Dim thisConnection As SqlConnection = New SqlConnection("Data Source=.;Integrated Security=SSPI;Initial Catalog=Video")

        Dim sql As String = "SELECT * FROM Products"
        Dim da As New SqlDataAdapter(sql, thisConnection)

    Friday, November 9, 2007 8:27 PM