|
-
Sep 9th, 2007, 02:19 AM
#1
Thread Starter
Junior Member
[2005] How to Connect ListView with view??
I have a view named 'showDetails' i want to connect it with list view???
-
Sep 9th, 2007, 02:28 AM
#2
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.
-
Sep 9th, 2007, 03:09 AM
#3
Thread Starter
Junior Member
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....
-
Sep 9th, 2007, 03:18 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|