Results 1 to 4 of 4

Thread: [2005] How to Connect ListView with view??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    31

    [2005] How to Connect ListView with view??

    I have a view named 'showDetails' i want to connect it with list view???

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to Connect ListView with view??

    What do you mean by a "view"? Are you talking about a view in a database? A DataView? Something else? Please state clearly what you mean so we don't have top assume, which may lead to wasting our time and yours with irrelevant information. It's a rare question that can be adequately and politely conveyed with such a short post.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    31

    Re: [2005] How to Connect ListView with view??

    surely its a view from Database.... & the source is something like this:

    Create View viewName
    as
    select * from tableName, tableName2....

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to Connect ListView with view??

    Particularly from someone with 16 posts, it could have been anything. My first thought was that it was in a database but many people have meant other than the seemingly obvious in the past. If you mean something then post it. It will only cost you a few seconds.

    So, to the solution. First off, do you know anything about ADO.NET and data access in .NET apps? If not then I suggest that you take a look at this thread. Note that you can specify the name of a view instead of a table without any other changes required.

    I'd probably suggest that you use a DataGridView rather than a ListView, unless there's some specific reason you need a ListView. Once you have the data in a DataTable it's one line of code to bind that to the grid and everything else is done for you. The ListView doesn't support data-binding so you'd have to create ListViewItems manually, transfer the data from a DataTable or DataReader and add them one by one. There's also no facility to edit the data.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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