|
The problem is you're using Image.FromFile to load the image. This will lock the file for the lifetime of the Image object.
Instead, you want to do this:
Dim pic As Bitmap
Using fs As New FileStream("C:\Aman\ZeqGraph\temp.jpeg", FileMode.Open, FileAccess.Read)
pic = New Bitmap(fs)
End Using
PictureBox1.Image = pic
|
|
|
|
|
Wasn't this just asked? LOL.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Yep, Jan 2 by TheComputerMan.
Amazing, noone ever actually reads the forums...
|
|
|
|
|
Thanks very much Dave, it works now.
|
|
|
|
|
I have never used SQL, and am trying to learn.
I have downloaded the SQL Server 2008 Express with Advanced Items.
(Boy that took quite some time to download(Several attempts) and then to configure and install!)
I purchased the SQL Server for Dummies.
Here is where I am running into trouble. It, (The Book) talks of the Management studio, but this appears not to be part of the download.
(Am I doing something wrong?)
Also, Is there a recommended site showing how to use SQL within VB directly? (Need to create one, add items, create links between data etc).
It is important to remember that I know NOTHING about SQL, and need to start from first priciples and be walked through each stage with my hand held.
Recommendations and help please!
------------------------------------
"The greatest tragedy in mankind's entire history may be the hijacking of morality by religion"
Arthur C Clarke
|
|
|
|
|
Dalek Dave wrote: Here is where I am running into trouble. It, (The Book) talks of the Management studio, but this appears not to be part of the download.
(Am I doing something wrong?)
I don't believe that it is. It comes with the other editions tho'.
Dalek Dave wrote: Also, Is there a recommended site showing how to use SQL within VB directly? (Need to create one, add items, create links between data etc).
There are a multitude of ways of using SQL in VB. If you simply want to just get started the the most basic is to create a SqlConnection , a SqlCommand and have it ExecuteReader to get a SqlDataReader back or ExecuteNonQuery if you are not selecting anything. There are many tutorials on this. Look up ADO.NET, and you should also get examples by looking up the highlighted terms in the MSDN Library.
Finally, if you help with your connection strings, try http://www.connectionstrings.com/[^]
Hopefully this will give you some pointers as to where to look.
|
|
|
|
|
Dalek Dave wrote: I have downloaded the SQL Server 2008 Express with Advanced Items
Dalek Dave wrote: It, (The Book) talks of the Management studio, but this appears not to be part of the download
According to this[^] (which is what I assume you downloaded) it does have something called "Management Studio Basic" which I would guess is in your Start->Programs menu somewhere. I would guess that this will give you enough for the basic operations to manage SQL Server Express.
|
|
|
|
|
Hi DD!
Management studio is a separate download. Go here[^]
Hope this helps.
[Mod]
But see discussion below before deciding.
[/Mod] Last modified: 2hrs 27mins after originally posted --
Honi soit qui mal y pongs - Evil to he who thinks it stinks
|
|
|
|
|
That's the wrong version of SQL Server. Dalek Dave has SQL Server 2008 express. If he uses that then there will be features he cannot use because the tools don't match the database engine. Also, there are issues with mismatched tools and installation order.
|
|
|
|
|
Thanks for that. I wasn't aware of any issues re installation order.
It is the Management Studio that I use and it seems to work OK with SQLExpress 2005 and SQLExpress 2008. As to missing features, I cannot comment as this is the first version of the manager that I have used in earnest, although I had the manager for 2005 installed previously.
When I downloaded it I chose that one because it did not have a version number in the name, i.e. it was not labelled SQLExpress Manager 2005, or whatever.
When I installed it it complained because I had 2005 Manager installed, so I uninstalled 2005 version and it installed OK. As I said earlier it looks to me as though it works fine, although I am no expert, as you can probably tell.
Honi soit qui mal y pongs - Evil to he who thinks it stinks
|
|
|
|
|
Henry Minute wrote: It is the Management Studio that I use and it seems to work OK with SQLExpress 2005 and SQLExpress 2008.
If it is already installed it will do up to a point. The Enterprise Manager (from SQL Server 2000) will also work (up to a lesser point), however you don't get the benefit of any new features or improvements. The biggest improvement is Management Studio 2008 supports Intellisense. But there are improvements to do with additional features of the database engine, e.g. Spatial Query support
The main issue with installation order is that two versions of Management studio clash. Especially if you have the version of SQL Server 2005 Express that came with Visual Studio 2008 because not many people realised it silently installed it if you just went with the default install. That particular version seems to cause endless problems if it comes into contact with SQL Server 2008 express (or even the developer edition)
|
|
|
|
|
OK.
You are quite right, as was your original post, which I have now read with more care.
I guess that I got over-excited at the thought that I could actually help somebody.
Sorry! Won't do it again. Honest.
Honi soit qui mal y pongs - Evil to he who thinks it stinks
|
|
|
|
|
Henry Minute wrote: Won't do it again
I little over exuberance never hurt.
|
|
|
|
|
Further looking around and reading is due over the next few days!
------------------------------------
"The greatest tragedy in mankind's entire history may be the hijacking of morality by religion"
Arthur C Clarke
|
|
|
|
|
im really stuck , i want to get the cover art of current song playing in itunes and simply display the image. using the itunes lib dll.
i been able to get the current track name and info like that(text) ...so my references are correct ect but i can get the cover image.
i have found this vb 6 script that doesnt work just gives errors
iTunes play event
Private Sub iTunes_OnPlayerPlayEvent(ByVal iTrack As Variant)
‘Find the current track
Set Track = iTunes.CurrentTrack
Dim Art1 As iTunesLib.IITArtworkCollection
Dim Art2 As iTunesLib.IITArtwork
Set Art1 = Track.Artwork
If Art1.Count > 0 Then
Set Art2 = Art1.Item(1)
Art2.SaveArtworkToFile ("C:\art\" & Track.Artist & " - " & Track.Album & ".jpg")
Open "C:\art\config.txt" For Output As #5
Print #5, Track.Artist & " - " & Track.Album
Close #5
End If
End Sub
has anyone got this working , all i need is a simple example to help me get on . Any help would be great .
thanks
luke
|
|
|
|
|
did you get this working? i'd like to see how you accomplished this!
|
|
|
|
|
hi I need help I am very need the source code to generate barcode by any font in (vb6)
thanks for any body can help me
|
|
|
|
|
|
Im suppose to have an app where it will compare two folders, Folder A and Folder B. It will check whether files in folder A are in folder B. If the file in folder A are not in folder B, it will display the name of the files that are not in folder B. This is the coding that i manage to do.. But nothing happen when i click the button check.. PLsss sumbody help me..
Private Sub btncheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncheck.Click
Dim di1 As DirectoryInfo = New DirectoryInfo(txtdir1.Text) ' Folder A
Dim di2 As DirectoryInfo = New DirectoryInfo(txtdir2.Text) ' Folder B
Try
Dim dirs1 As FileSystemInfo() = di1.GetDirectories
Dim dirs2 As FileSystemInfo() = di2.GetDirectories
Dim d1, d2 As DirectoryInfo
Dim i As Integer
For i = 0 To dirs1.Length - 1
For Each d1 In dirs1
Dim f1 As FileInfo() = d1.GetFiles()
For Each d2 In dirs2
Dim f2 As FileInfo() = d2.GetFiles()
If d1.Name = d2.Name Then
Else
Console.WriteLine(d1.Name)
End If
Next
Next
Next
Catch ex As Exception
End Try
End Sub
Private Sub btndirectory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndirectory.Click
Dim folderopen As New FolderBrowserDialog
With folderopen
.RootFolder = Environment.SpecialFolder.Desktop
.SelectedPath = "C:\DOCUMENT"
.Description = "Select the source directory"
If .ShowDialog = Windows.Forms.DialogResult.OK Then
' Display the selected folder if the user clicked on the OK button.
MessageBox.Show(.SelectedPath)
txtdir1.Text = .SelectedPath
End If
End With
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lbldate.Text = Now.ToLongDateString
End Sub
Private Sub btndirectory2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim folderopen As New FolderBrowserDialog
With folderopen
.RootFolder = Environment.SpecialFolder.Desktop
.SelectedPath = "C:\DOCUMENT"
.Description = "Select the source directory"
If .ShowDialog = Windows.Forms.DialogResult.OK Then
' Display the selected folder if the user clicked on the OK button.
MessageBox.Show(.SelectedPath)
txtdir2.Text = .SelectedPath
End If
End With
End Sub
|
|
|
|
|
zaimah wrote: Catch ex As Exception
End Try
Great. First you throw away all available information about possible exceptions, and then
you ask the CP community what goes wrong in your program.
NEVER ignore exceptions the way you did. Log them, print them to the console, count them, whatever
but don't let them go unnoticed.
|
|
|
|
|
shame on me iv just put MsgBox(ex.Message) between Catch ex As Exception and End Try.. but still nothing happen.. i know my question sound a bit stupid.. im new in this.. and thanks a lot for the reply
|
|
|
|
|
OK, now start debugging, i.e. either add some output statements so you can see what is going on,
or use single-stepping and watch the values.
how many entries are in dirs1 and dirs2?
you are aware you are comparing two folders assuming they contain just 1 level of subfolders and no
files at the toplevel?
strange code:
Why is there a for i loop?
what is the use of f1 and f2? you assign a value to them but never use them? all you do is compare the names of the subfolders!
modified on Saturday, January 3, 2009 8:03 AM
|
|
|
|
|
actually i have to compare lots of folder.. like this, there are 280 folder under customers id.. each of the customers folder, there are files .. we have to compare source folder with the folder in portal.. with this prgm, to make sure that we know which r the files in the source have not been copied.. so i will choose one customer's folder the source and the portal... the folder only hv 1 level subfolder.. i hv tried to put sum outpt statements.. when i put console.write"Hello" after Try, it doesnt display "Hello", but if i put MsgBox("Hello") after Try the msg box came out. When i put msgbox inside For Each d1 in dirs1, nothing come out.. so it must be sum thing wrong with my For Each statements.. and one more thing, why console.write doesn't work? and the i loop is actually i want it to compare with all the files in the source folder.. lets say the source have 14 files and the portal only got 10.. it must check all 14 between all 10 files in portal.. when i test it with the output staments, i put out the i loop.. bcoz im afraid it will effect the output.. iv just notice about the unused f1 and f2.. thanks
|
|
|
|
|
Hi,
as I said before, your code does not make much sense: i, f1 and f2 are assigned a value but never used.
zaimah wrote: When i put msgbox inside For Each d1 in dirs1, nothing come out
maybe dirs1 is empty so the foreach gets skipped.
|
|
|
|
|
i have throw the i, f1 and f2.. the possibility for the folder is empty is there, but i tried with folder level 1,2 and 3.. still nothing come out... if f1 n f2 is not there anymore, logically if i put
For Each d1 In dirs
MsgBox("Hello") <-- at least it will execute this command to display the word. but nothing come out.
if i, f1 and f2 is out of the coding, what is the possibility of error in my coding? is there sum thing wrong with the coding? or is there sum thing wrong with me?
|
|
|
|