query from a listview result, code used in vb6 not working in --- help ---

Posted on 2007-10-19
Last Modified: 2013-11-26
Hey guys i am trying to query based from the result from the listview box, i am using the code that works in vb6 but doesnt want to work in .net

some help would be great

        sql = "select * from [stock_card] where [stockid] =   " & ListView1.SelectedItems.Item(1)
Question by:awolarczuk
    LVL 53

    Accepted Solution

    sql = "select * from [stock_card] where [stockid] =   " & ListView1.SelectedItems.Item(1).Text

    What error are you getting ? Is your sql correct ? Do you have a problem executing the statement and getting the values, ...

    Author Comment

    didnt have to .text that wasnt neededin the vb6 one thanks for that

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now