|
The reason you are getting a Stack Overflow Error is because in your code, FormClosing allows you to perform last minute steps before the app shuts down. So when your app tries to close, you call Me.Close() which loops back and calls the same function continually.
I hope that makes since.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Yeah i get it. The reason i am trying to use it, is because the first form, i want to show another one and CLOSE the original form, however, when i close the first form, the whole program closes, so i had to hide it to get around this. Is there any way to get around this??? Sorry to bother you all, I'm just really stuck and its annoying!!
|
|
|
|
|
Well you can just hide the first form (Me.Hide() ), and then when you want to close all the forms, use Application.Exit() .
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
well i think if first form is hidden by using me.hide(), then u wont be able to close it through form2(or your most active form)using that cross button in controll box. and even if you could then why to increase complexity.
jst hide yr form one and close yr succesive forms by me.close
and appliction.exit on the last form will be the easiest way...
try it out...
|
|
|
|
|
Why are my validator controls grayed out in VS 2005 for a Windows app? Ive never had that issue before but this is the first time Ive tried to use them in 2005.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Dunno, tell us more.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Well according to this[^] it looks like they arent used to Windows Apps anymore, but I could swear they were available for Windows Apps for 1.1. Oh well, I have no problem with just looking at the controls and popping up a message box, but Im curious as to why they arent available for Windows Apps anymore.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I populate two datagrids from queries to Access databases by calling GridPopulate_TS() from a thread.
The first time the datagrids are populated.
However if GridPopulate_TS() is called a second time the datagrids do not get populated with the new data (they remain populated with the old data).
It is as though the datagrids become stuck!
Anyone have any ideas that may help?
<code> Public Sub GridPopulate_TS()
Dim oDel As New _
GridPopulateDelegate( _
AddressOf Me.sendScanToGrid)
Me.Invoke(oDel)
End Sub
Public Delegate Sub GridPopulateDelegate()
Public Sub sendScanToGrid()
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" + AccessDB
con.Open()
ds.Clear()
sql = "select * from qryFileInfo"
da = New OleDbDataAdapter(sql, con)
da.Fill(ds, "fileinfo")
DataGrid1.SetDataBinding(ds, "fileinfo")
DataGrid1.ReadOnly = True
sql = "select * from qryFileTypeInfo"
da = New OleDbDataAdapter(sql, con)
da.Fill(ds, "filetypeinfo")
DataGrid2.SetDataBinding(ds, "filetypeinfo")
DataGrid2.ReadOnly = True
con.Close()
End Sub<code></code></code>
|
|
|
|
|
Ok I fixed it.
By setting a new binding context each time the datagrids are populated.
This took me four hours of trawling the internet and experimentation - so I hope it is of help to others.
<code>Public Sub GridPopulate_TS()
Dim oDel As New _
GridPopulateDelegate( _
AddressOf Me.sendScanToGrid)
Me.Invoke(oDel)
End Sub
Public Delegate Sub GridPopulateDelegate()
Public Sub sendScanToGrid()
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" + AccessDB
con.Open()
ds.Clear()
sql = "select * from qryFileInfo"
da = New OleDbDataAdapter(sql, con)
da.Fill(ds, "fileinfo")
DataGrid1.BindingContext = New BindingContext
DataGrid1.SetDataBinding(ds, "fileinfo")
DataGrid1.ReadOnly = True
sql = "select * from qryFileTypeInfo"
da = New OleDbDataAdapter(sql, con)
da.Fill(ds, "filetypeinfo")
DataGrid2.BindingContext = New BindingContext
DataGrid2.SetDataBinding(ds, "filetypeinfo")
DataGrid2.ReadOnly = True
con.Close()
End Sub</code>
|
|
|
|
|
How do i get the datatype size of a column or an attribute from a database...
i am working on my academic project and my topic is database migartion....
and i am doing it using vb.net 2005...
as soon as i complete my project i'll post it here,....
i needed help... i am stuck half the way thru...
i want to know how to return or retrieve the datatype size from a source database... i need that size so that i can get the datatype name and size from source database and i want to create a table with the same table name with same attribute name and size... in the destination source....
sorry.. my english is worst .. hope u understand what i meant...
this is my 1st post plz dont disappoint me.. i am a total newbie...
thanking you...in advance
Abhijith
Abhijith
|
|
|
|
|
Abhijith Rao wrote: How do i get the datatype size of a column or an attribute from a database...
What database?
In SQL Server 2000 you can write something like this:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Products'
|
|
|
|
|
sorry i was not able to put my view into words.. ok lemme explain... with example...
if i am connected to oracle database.. i want to read the column names,their datatype(such as varachar,number),and their datatype size
(varchar(100)... using getDatatype returnns varchar2 but not their size which is 100 here.)
how do i do that in vb 2005 which method would return me the sizes of the datatype...
i want to do that for MSACCESS,MS SERVER 2000,MS SERVER 2005,AND ORACLE...
HOPE THIS CONVEYS..
Abhijith
|
|
|
|
|
i am waiting for u r valuable solutions please help....
Abhijith
|
|
|
|
|
Does anybody know anything about writing code to function with network cameras? I’m trying to find a solution for monitoring my children and I would like to write an application that will detect motion and sound from a network camera.[^] When motion or sound is detected I would like the application to become active with the view that detected the sound or motion.
This is just a concept right now. I haven’t even purchased the camera yet. I’m just wondering if it is possible or worth the effort.
I appreciate any input including positive or negative experiences with this.
Thanks
Brad
|
|
|
|
|
It looks like it already supplies most of what you'd need, short of a web server or media server. If you wanted to do your own custom solution, you'd have to have an SDK from the manufacturer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: It looks like it already supplies most of what you'd need
That’s right. I’d like to grab the External Trigger and Motion Alarm Output and force the camera application (or my own application (with theirs embedded??)) to be active. Maybe the cameras software already does this but other cameras that I’ve looked at simply use this feature to send an email.
For example, if I’m working on my computer and one of the cameras is activated I’d like that camera view to open “in front” of what ever else I have opened.
I don’t have any experience with this but I’m assuming that the manufacturer would not be very likely to give out the SDK without me forking over a good bit of cash.
|
|
|
|
|
Brad Fackrell wrote: I’m assuming that the manufacturer would not be very likely to give out the SDK
I stand corrected. I just contacted the company that sells the camera and they are going to send me the SDK.
|
|
|
|
|
Brad Fackrell wrote: but I’m assuming that the manufacturer would not be very likely to give out the SDK without me forking over a good bit of cash.
Not really. Most companies supply their SDK's for free (if they have one!), or there's a charge that's normally not very high. But, there's only one way to find out - give them a call!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am writting a window form application in VB.NET
I need to get the drive letter, because my program run from CD ROM
Thanks
-- modified at 11:29 Thursday 22nd March, 2007
1) I am writting the following lines:
dim MyPath as string
MyPath=System.Windows.Forms.Application.StartupPath
System.IO.Path.GetPathRoot(MyPath)
2) I am publishing my application
3) I am running the application from drive F:\
4) I get that the "MyPath" variable is equal to "C:\...local....\" but not "to F:\..."
Please help
Eric H.
|
|
|
|
|
Application.StartupPath ( from memory ) will include the current drive letter.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I did a modification in the same time that you answer me.
Please check again
Thank you
Eric H.
|
|
|
|
|
The reason it's comming up with C:\Documents and Settings\... is because you're launching the .EXE from inside Visual Studio, not the F: drive.
StartupPath returns the full path of the folder that the .EXE started from.
If you want to test your app with a CD in the drive, complete with all your data, you'll have to modify your code a bit to include a static method that returns a path dependant on some condition, like if the startup path is rooted on C:, return a path that is rooted on F: instead.
Public Shared Function GetApplicationStartupPath() As String
Dim realPath As String = Application.StartupPath
If Path.GetPathRoot(realPath).StartsWith("C:") Then
' Return a bogus path to the root of the CD drive for testing
Return "F:\"
End If
' Return the real path were using
Return realPath
End Function
Or you could use compiler directives to do the same thing. DEBUG will only be defined if the code is compiled and run from inside Visual Studio using the Debug build configuration. A Release version won't have DEBUG defined.
Public Shared Function GetApplicationStartupPath() As String
#If DEBUG Then
' Return the bogus path to the CD drive, used for testing...
Return "F:\"
#Else
' Return the actual StartupPath
Return Application.StartupPath
#End If
End Function
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
Sorry but I don't know at least what will be the drive letter. I need to know it at run time.
I am new in VB.NET environment, my problem may be a configuration problem:
I create a new project (VS2005) as following, please do as I am doing:
1. File->New Project->RunFromCD(is the window application name).
2. Drag a new button (button1)
3.Here is the code
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(GetApplicationStartupPath())
End Sub
Public Shared Function GetApplicationStartupPath() As String
Dim realPath As String = Application.StartupPath
Return Path.GetPathRoot(realPath).ToString()
End Function
End Class
4. Build-> Publish RunFromCD->Next->From a CD-ROM or a DVD-ROM->Finish
5. Now I get a Published folder as following
- RunFromCD_1_0_0_1 (folder)
- RunFromCD.application
- RunFromCD_1_0_0_1.application
- setup.exe
6. I am copying all the published folder to drive D:\ and running the setup.exe, after clicking on the button1, I get from message box:
"C:\" but I expect "D:\"
Thanks you a lot for your help
Eric H.
|
|
|
|
|
I have always done my own coding for the data piece but now that 2.0 is supposed to be so great Ive decided to take a shortcut with an application and just use the control binding along with the DataGridView which is bound to a table in the database.
How much code am I required to write myself when I use this method as opposed to manually creating my own dataset and my own update/insert/delete commands etc.? I thought it was supposed to do more work for me, the only command it actually created is the Insert command, so when I update a row and set it as modified by using the .BeginEdit/.EndEdit it says there is no Update command. Well if Im using the automatic setup here, I dont want to go into the Dataset code and write it myself when I believe it should write it for me ARGHHH!!
The problem is that Im used to adding the rows to the datatable myself, finding and editing that particular row then just updating the specific rows that I updated from the app. Im not used to just saying here's my data and figure out what's updated and what's not and do all the work.
-- modified at 9:02 Thursday 22nd March, 2007
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I would recommend never doing this for real world applications, it moves your data access code too close to the presentation tier for my liking. You are indeed expected to put SQL in your code. You *can* tell it to call a proc, which I would regard as acceptable.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|