Friday, January 27, 2012

How do you search an array which is in an Array List? C#?




Create a program which accepts input by the user about many books as he wants.





The book details which the user will input will consist of the following:


鈥?Isbn


鈥?Name


鈥?Published Date





These details about 1 book should be stored in an array of strings and then the array is to be stored in an ArrayList which will hold more of these arrays.





Therefore, in the end, the ArrayList will consist of more than 1 array of strings.


--------------------------------------鈥?br>




My question:





How can i then search for a particular book by isbn or name using foreach?





Thank you in andvance|||Assuming you are using .NET 3.5, LINQ is exactly what you need here.





You can search collections (lists) using SQL-like commands to bring back exactly what you need.





This will be a brilliant starting point for you, and will do exactly what you need.





A quick google search threw up this site:





http://www.theserverside.net/tt/articles鈥?/a>





Good luck!

No comments:

Post a Comment