malanois
asked on
OLEAdapter Fill ISALIVE
Is there something out there that would work for
an OLDBAdapter.Fill
do while FillThread.IsAlive
ProgressBar.Value += 1
If ProgressBar.Value = 100 then ProgressBar.Value = 0
loop
an OLDBAdapter.Fill
do while FillThread.IsAlive
ProgressBar.Value += 1
If ProgressBar.Value = 100 then ProgressBar.Value = 0
loop
ASKER
I am trying to show the status of a search
i am using a ProgressBar to accomplish
' Set the SelectCommand to the newly constructed query
Me.OleDbSelectCommand1.Com mandText = cmdText
'Execute the query
DbDataSet.Clear()
'ProgressBar1.Step = 1
'Do While ????????.IsAlive()
'ProgressBar1.Value += 1
'If ProgressBar1.Value = 100 Then ProgressBar1.Value = 0
' Loop
Me.OleDbDataAdapter1.Fill( Me.DbDataS et)
I need to show the status of the Fill
i am using a ProgressBar to accomplish
' Set the SelectCommand to the newly constructed query
Me.OleDbSelectCommand1.Com
'Execute the query
DbDataSet.Clear()
'ProgressBar1.Step = 1
'Do While ????????.IsAlive()
'ProgressBar1.Value += 1
'If ProgressBar1.Value = 100 Then ProgressBar1.Value = 0
' Loop
Me.OleDbDataAdapter1.Fill(
I need to show the status of the Fill
That would be making the assumption that the Fill method uses threading which cannot be shown anywhere within the framework for the OleDbDataAdapter.Fill method. You would need to be able to dig through and find the thread ID to retrieve a reference to it, which is definitely not a trivial task, even if the thread existed. I don't think that you are going to be able to do it this way.
Bob
Bob
ASKER
What would be some options?
I need to show some type of status for the search.
Thank YOU
MJ
I need to show some type of status for the search.
Thank YOU
MJ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It will not show the image???
what would be wrong??
DbDataSet.Clear()
showimage()
Me.OleDbDataAdapter1.Fill(
hideimage()
End Sub
Public Sub showimage()
showbx.Show()
End Sub
Public Sub hideimage()
showbx.Hide()
End Sub
Try:
showimage
Application.DoEvents <-- add this.
Fill
hideimage
Bob
showimage
Application.DoEvents <-- add this.
Fill
hideimage
Bob
ASKER
hmmmmm????????
The gif comes up,
however the animation only shows on bar and hangs.???
The gif comes up,
however the animation only shows on bar and hangs.???
What happens if you don't do the Fill and don't hide the image? Does the animation work correctly?
Bob
Bob
ASKER
yes it works if i dont hide and unhide
Take a look here:
https://www.experts-exchange.com/questions/21132894/run-animated-gif-on-onclick.html#12081514
I learned something new, without even having to ask a question :)
Bob
https://www.experts-exchange.com/questions/21132894/run-animated-gif-on-onclick.html#12081514
I learned something new, without even having to ask a question :)
Bob
ASKER
that is great
Thank You so Much
:)
MJ
Thank You so Much
:)
MJ
ASKER
Well now you got me thinking,
Im trying to play with this.
Ive searched a couple items about thread and I keep getting errors
Private thread As System.Threading.Thread
Public Sub Threading()
thread = New System.Threading.Thread(sh owimage)
End Sub
Public Sub showimage()
showbx.Show()
End Sub
Public Sub hideimage()
showbx.Hide()
End Sub
?????????????????????
MJ
Im trying to play with this.
Ive searched a couple items about thread and I keep getting errors
Private thread As System.Threading.Thread
Public Sub Threading()
thread = New System.Threading.Thread(sh
End Sub
Public Sub showimage()
showbx.Show()
End Sub
Public Sub hideimage()
showbx.Hide()
End Sub
?????????????????????
MJ
malanois, I have converted the code to VB for your convienence:
Public Sub ShowImage()
pictureBox.Show()
End Sub
Public Sub HideImage()
pictureBox.Hide()
End Sub
Private Sub DoWork()
ShowImage()
// Do your work here
HideImage()
End Sub
Private Sub StartDoWork()
Dim workThread As New System.Threading.Thread(Ad dressOf DoWork)
workThread.Start()
End Sub
Just call StartDoWork() to get the process going!
Public Sub ShowImage()
pictureBox.Show()
End Sub
Public Sub HideImage()
pictureBox.Hide()
End Sub
Private Sub DoWork()
ShowImage()
// Do your work here
HideImage()
End Sub
Private Sub StartDoWork()
Dim workThread As New System.Threading.Thread(Ad
workThread.Start()
End Sub
Just call StartDoWork() to get the process going!
ASKER
thanks
SOORY, Don't know what I was thinking, but I never finished the code!
Correction to these two functions:
Private Sub DoWork()
Invoke(New System.Threading.ThreadSta rt(Address Of ShowImage))
System.Threading.Thread.Sl eep(5000)
Invoke(New System.Threading.ThreadSta rt(Address Of HideImage))
End Sub
Private Sub StartDoWork()
Dim workThread As New System.Threading.Thread(Ad dressOf DoWork)
workThread.IsBackground = True
workThread.Start()
End Sub
Correction to these two functions:
Private Sub DoWork()
Invoke(New System.Threading.ThreadSta
System.Threading.Thread.Sl
Invoke(New System.Threading.ThreadSta
End Sub
Private Sub StartDoWork()
Dim workThread As New System.Threading.Thread(Ad
workThread.IsBackground = True
workThread.Start()
End Sub
Bob