|
-
Mar 27th, 2003, 02:51 AM
#1
Thread Starter
Fanatic Member
some problem need help as i just started VB.net
i have some problem and i am not sure with my approach. can any one help me out.
my solution has Sub Main as startup
Code:
Module Mod_Main
Public Sub Main()
g_strAppDir = Application.ExecutablePath
Dim frm As New Frm_Logon()
frm.Show()
Application.Run()
End Sub
......
when i use only frm.Show() disapper after show. so i have used Application.Run() what can be the problem and using Application.Run() is correct.?
now we can create Dataset in diff way i have choose one
i have created .xsd and .vb file using vs for dataset.
i did by adding a dataset component and defining the structure and relation
i have a sub Init_DataSet() for loading the data... but seem to have some problem is my approach correct...
Code:
Public Sub Init_DataSet()
Try
Cn.Close()
Dim OIT_Folder_SelectCmd As New SqlClient.SqlCommand("select * from OIT_FOLDER", Cn)
Dim OIT_Folder_UpdateCmd As SqlClient.SqlCommand
Dim OIT_Folder_Adapter As SqlClient.SqlDataAdapter
Dim OIT_File_SelectCmd As New SqlClient.SqlCommand("select * from OIT_File", Cn)
Dim OIT_File_UpdateCmd As SqlClient.SqlCommand
Dim OIT_File_Adapter As SqlClient.SqlDataAdapter
Dim OIT_Permissions_SelectCmd As New SqlClient.SqlCommand("select * from OIT_Permissions", Cn)
Dim OIT_Permissions_UpdateCmd As SqlClient.SqlCommand
Dim OIT_Permissions_Adapter As SqlClient.SqlDataAdapter
OIT_Folder_Adapter.SelectCommand = OIT_Folder_SelectCmd
Cn.Open()
OIT_Folder_Adapter.Fill(g_Ds, "OIT_Folder")
'OIT_File_Adapter.SelectCommand = OIT_File_SelectCmd
'OIT_File_Adapter.Fill(g_Ds, "OIT_File")
'OIT_Permissions_Adapter.SelectCommand = OIT_Permissions_SelectCmd
'OIT_Permissions_Adapter.Fill(g_Ds, "OIT_Permissions")
Catch e As Exception
MsgBox(e.Message)
End Try
End Sub
and when i execute the Init_DataSet() sub i got some waring not sure what are there....
Could not copy temporary files to the output directory.
The file 'OrganiseIT.NET.exe' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.
The file 'OrganiseIT.NET.pdb' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.
[/CODE]
-
Mar 27th, 2003, 07:13 AM
#2
Thread Starter
Fanatic Member
i make is simple
if i start my app from sub main why does frm.Show() does not work...
why shd i add Application.Run()
dataset i was able to handle..... in difff.. just for info
which is a better way to use dataset...runtime add or define in design or add dataset component.
-
Mar 27th, 2003, 07:35 AM
#3
I dont remember the exact command, but I think it is form2.ShowModal(). That will show your form and not cause the application to stop running.
-
Mar 27th, 2003, 01:40 PM
#4
Sleep mode
I've tried this and worked fine (without application.run)
VB Code:
Module Module1
Public Sub Main()
Dim frm As New Form()
frm.ShowDialog()
End Sub
End Module
-
Mar 27th, 2003, 07:01 PM
#5
Fanatic Member
Question? Why use sub main to start the application?
why not declare form1 as the startup object
then in either the new constructor or in form_Load event branch off to execute any functions or subs you need to execute to complete the initialisation of the form
I have often found that keeping things simple is the best answer to any problem (often not always)
-
Mar 27th, 2003, 10:01 PM
#6
Sleep mode
What you are trying to do in your proj is most suitably for Console apps ! So build your proj as a windows application !
Last edited by Pirate; Mar 27th, 2003 at 10:04 PM.
-
Mar 28th, 2003, 02:25 AM
#7
Thread Starter
Fanatic Member
well thanks a lot guys....
i am connecting in submain and next is my login screen and then come main windows. the flow is like this...
one at a time... first come first bases
Negative0 --- form2.ShowModal
if i use showmodal then if i login is complete and i need to show frmmain. then i need to close the login form then whole app closes... so cannot use showmodal
Pirate --- my early say the same...
rudvs2 -- i need t have a submain in my solution. so cannot change it...
if i use application.run and to exit applican.exit it work fine... but some times the applican.exe in bin folder still in use after the app close...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|