![]() |
| ||
| Help with Search & ListView codes. Hi, hope everyone here is dong fine. Can anyone please help me with my coding. This is the code to fetch the book name from INPUT box and display it in a TextBox(which is limited). But I want the records to be displayed on a ListView with several others having similar(closest to) name. But I am struggling with the code on how to show the records in ListView. prompt$ = "Please enter the book name" I tried to create the columns using this codes: ListView1.Columns.Add("Title", 10, HorizontalAlignment.Left)Which is not working!! And how do i add the records from the database?? Basically I am struggling with the code to display the records on ListView from the Database. Can anyone please give me some hints. Thanks a lot. |
| ||
| Re: Help with Search & ListView codes. Quote:
Listview.listItems.Add Index, Key, Text, Icon, SmallIcon as ListItem If you're using a database recordset, you might try using a loop with the EOF property. With MyDatabase I don't use these listviews much; but I think that the Columns property is intended to design the listview on the fiy. If you want to add items, I would say to use the ListItems Method. |
| ||
| Re: Help with Search & ListView codes. Thanks hkdani for the help. I have tried it in the application and its working(partly). I can display the data’s in ListView. But it just displays the data’s in a random manner and also without column names. (no rows or columns….just one line or in multiple lines) I first query for a name in my Find/Search text box like, select * from Book_Details where Book_Name = '" & SearchStr$ & "' or Book_Name like '%SearchStr%'"I hope this is a standard code… and then result of this query is to be displayed in a ListView1. So I used your code.. With Data1.RecordsetNow this code displays the data’s but without the column names and that too in a random manner. Can anyone please suggest how to correct this. Thanks again. |
| ||
| Re: Help with Search & ListView codes. http://msdn.microsoft.com/en-us/libr...52(VS.60).aspx The above was just my meager attempt to get you started. You need to use the report format. The MSDN link above should give you the information you need to accomplish your task. Hank |
| All times are GMT -4. The time now is 5:47 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC