Delete Image
Delete Image
Delete Image
Delete Image
Delete Image
Delete Image Delete Image Delete Image Delete Image Delete Image Delete Image Delete Image Delete Image
Delete Image Delete Image
Delete Image
Go Back  Xtreme Visual Basic Talk > > > Delete Image


Reply
 
Thread Tools Display Modes
  #21  
Old 07-25-2013, 10:51 AM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default


Deletes it just fine, that way.

It must be something that the database
is doing that keeps the image file location
in the system memory.

Let me go through my code more carefully
to see what i can find and i'll get back to you.
Reply With Quote
  #22  
Old 07-26-2013, 08:29 PM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default

I'll have to close this thread because
my laptop keyboard quit working and
i found that my anti-virus was non
operational.

I suspect some trojan must have gotten
in and screw with my laptop.

As a result, i had to reinstall windows, VB Net
and the whole windows update thing and now
my program isn't working correctly at all.

A good thing might have come out of this though.
Since reinstalling VB Net, i now have the Server Explorer
tab displayed right there above my toolbox, where as
before, it wasn't present at all.

I don't know if that was preventing me from using
an sql database or not because before, i could not get
one to work right.

Maybe now, i can finally make one work for me.

I'm going to rewrite my database using sql and have the
images put inside the database.

I know people say that isn't a good idea because of
the bloating factor but what is the difference whether
i have my images inside a database or in a folder. The
bloating with still be taking place in either case. Either
the database will bloat up or the image folder will.

Anyway, Thanks for all the help.
Reply With Quote
  #23  
Old 07-31-2013, 12:58 PM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default

OK. Back open again.

Since reinstalling windows, i have finally
been able to pragmatically create my own
sql database, create tables and fields and
add/delete records from it.

I created two databases. One that held images
and one that held image locations.

I used the one that held images first and found
out that the database size was double what the
image folder, with images in it, was.

The image folder was around 29.5mb or so and the
image database was around 59.5mb.

I decided to stick with storing the image location,
instead.

I'm still using an sql database but i'm having the
same trouble with this database program, that i had
with the access database program.

I can't delete images from the image folder, when i
delete a record.. A system warning pops up and says
that my image is still in use by system and won't let
me delete it.

That's fine though. I said the hell with it. I'll leave the
unused images in the folder for now.

I'll tinker with it every now and then and maybe figure
out the problem. It's really not a big deal though.
Reply With Quote
  #24  
Old 07-31-2013, 01:32 PM
Gruff's Avatar
GruffDelete Image Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Glad to hear your system is bsck up.

Did you try my suggestion of wrapping your database IO into a class?
You can pass the image filename out of the class as a string property.

I would think that by separating the processes it would break any connection to the database.

Basically you write a function into your class that takes a Query and returns a datatable.
In your case I would also have it fill an image path property separately.
The other nice thing is it hides the complexity of whatever hoops your data io has to do.

Roughly something like the following.
---

Dim sQuery as string = "Your Query Here"
Dim oDB as new clsDB '<--- Your new class
Dim oTable as new DataTable = oDB.ReadDB(sQuery)
Dim sImagePath as string = oDB.ImagePath

Pic.Image = sImagePath

Textbox1.text = oTable.Rows(0).Item("FieldName").Tostring
'Etc...

The table would of course also contain the imagefile path, but you wouldn't be setting the picture image from it.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T

Last edited by Gruff; 07-31-2013 at 01:38 PM.
Reply With Quote
  #25  
Old 07-31-2013, 01:53 PM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default

This is going to sound crazy but just for
the halibut, i tried something that you told
me to try with the access database, and
this time, it works.

You had me try:
picImage.Image.Dispose
picImage.Image = Nothing

This is now working like a charm and the image
in the folder, is getting deleted.

Thanks Gruff
Reply With Quote
  #26  
Old 07-31-2013, 02:49 PM
Gruff's Avatar
GruffDelete Image Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Glad to hear you have it working.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Delete Image
Delete Image
Delete Image Delete Image
Delete Image
Delete Image
Delete Image Delete Image Delete Image Delete Image Delete Image Delete Image Delete Image
Delete Image
Delete Image
 
Delete Image
Delete Image
 
-->