By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Program opens DOS/command window - but it should not

P: 10
.Net Framework 4.0.30319 SP1Rel 2010 10.0.40219.1 SP1Rel
Windows 7

I have searched on the web for this, but all I can find is how
to USE a command window from, nothing on how to NOT
get the window. I need to not have the window come up.

This problem is both when running debug in the IDE and after installing
with the .MSI.

When one of the command windows comes up it has
as the title on the window. This is the .exe of the program I am
running. Nothing can be typed into the window.

One of the places it opens a command window is on the cn.Open()
statement below.

"Integrated Security=SSPI;Persist Security Info=False;Data Source=DEFDSDB56;
Initial Catalog=DEFDB_DEV;Connection Timeout=1200"

Expand|Select|Wrap|Line Numbers
  1.     Dim cmd As New SqlCommand
  2.     Dim cn As New SqlConnection(gConnectionString)
  3.     Dim dr As SqlDataReader
  5.     Try
  6.       cmd.Connection = cn
  7.       cmd.CommandText = "dbo.spSelectCurrent"
  8.       cmd.CommandType = CommandType.StoredProcedure
  9.       cn.Open()
  10.       dr = cmd.ExecuteReader
It also happens on this sleep statement, with the same title on the
Expand|Select|Wrap|Line Numbers
  1.       AboutdlgNew.Show()
  2.       Application.DoEvents()
  3.       Thread.Sleep(3000)
  4.       AboutdlgNew.Close()
  5.       AboutdlgNew.OKButton.Visible = True
By the way, I started this program as a new project in a new solution
and added 3 forms from an existing project: Copied files into the project
folder, Show All Files, right-click and Include. Then I had to define
Public ProgressfrmNew as New Progressfrm in order to use a form. I
doubt this is related to the problem I am having. The problem occurs
in a module, not a form.

Stored procedure:

Expand|Select|Wrap|Line Numbers
  1. Select *, 
  2.     Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') | Is_Member('DEFRURole') | Is_Member('DEFRRole') as Security_AuditsReadFlag,
  3.     Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') | Is_Member('DEFRURole') as Security_AuditsUpdateFlag,
  4.     Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') as Security_AuditsDeleteFlag,
  5.     Is_Member('DEFRUDARole') as Security_DataAdminFlag,
  6.     Is_Member('ARSAdminsRole') as Security_ARSAdminFlag,
  7.     Is_Member('ARSOnlineFormsURole') as Security_ARSOnlineFormsUpdateFlag
  8. From Users
  9. Where User_NTDomain + '\' + User_Login = sUser_sName()
I am in SQL Server 2008 R2.

Thanks in advance.
Oct 25 '13 #1
Share this Question
Share on Google+
1 Reply

P: 10
Finally, I created a new project in a new solution, copied form and module
files into its folder, Show All Files, Included files.
The new project did not get the error. Done!!!
Oct 25 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.