Click to See Complete Forum and Search --> : database problem


aamir55
September 18th, 2008, 10:19 PM
I am working on a project where I have to store the pictures into database and then retrieve them from database. I m using a two forms, one is the main form where I manage my photos and albums and second form where I display any picture on the picture box by double clicking on a thumbnail on form1.
Form1 contains a tree view, a list view and a picture box.
Tree view is used for arranging albums and photos. I can add a new album into the database and I can add photos in the any album. Root node of tree view is used for album and its nodes are used for photos. When I click on any album in tree view then thumbnails are generated for that album. And when I click on any photo (node) then its corresponding photo is displayed in the picture box on form1.
When I attach database files into sql server first time then theses problems occurred.
When I add album first time then add a photo into it then it displays following message displayed ”Object reference not set to an instance of an object” after pressing ok button then it is repeated for two times. Now album is added and picture is also added. But when I again click on album name to generate thumbnail for that image then again this message comes and when I select photo (node) in tree view then this message is displayed “This is already an Open Data Reader associated with this command which must be closed first”. After pressing ok button then first message is shown again. it continued until I close the application.



Now I close the application and run it again and now this problem is solved automatically.
Now I add another album . a new album is added to tree view and I click on it then problem is that when I click on it ,it shows also photos of first album which is not correct bcoz I have not added any photo in this album yet. When I add photo into second album then photo of first album is automatically added to it and now I close the application and run it again and second album disappears and its photo is added into the first album. I want that this album should be in the database and its photos should be in this album not in first album. This problem continued for few days and it automatically corrected but I want to know how to resolve it. I want the solution. I am worry about this situation.
i m attaching the file and also database files along it..kindly help me
i m also attaching MS Word file(database.doc) where u can find the detail and see the snapshots
thanks