Program opens DOS/command window - but it should not

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MLarsB
    New Member
    • Mar 2012
    • 10

    #1

    Program opens DOS/command window - but it should not

    .Net Framework 4.0.30319 SP1Rel
    vb.net 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 VB.net, 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
    "file:///C:/ProjsVB.net/ImportCSV/ImportCSV/bin/Debug/ImportCSV.EXE"
    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.

    gARSConnectionS tring:
    "Integrated Security=SSPI;P ersist Security Info=False;Data Source=DEFDSDB5 6;
    Initial Catalog=DEFDB_D EV;Connection Timeout=1200"

    Code:
        Dim cmd As New SqlCommand
        Dim cn As New SqlConnection(gConnectionString)
        Dim dr As SqlDataReader
    
        Try
          cmd.Connection = cn
          cmd.CommandText = "dbo.spSelectCurrent"
          cmd.CommandType = CommandType.StoredProcedure
          cn.Open()
          dr = cmd.ExecuteReader
    It also happens on this sleep statement, with the same title on the
    window:
    Code:
          AboutdlgNew.Show()
          Application.DoEvents()
          Thread.Sleep(3000)
          AboutdlgNew.Close()
          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:

    Code:
    Select *, 
    	Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') | Is_Member('DEFRURole') | Is_Member('DEFRRole') as Security_AuditsReadFlag,
    	Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') | Is_Member('DEFRURole') as Security_AuditsUpdateFlag,
    	Is_Member('DEFRUDARole') | Is_Member('DEFRUDRole') as Security_AuditsDeleteFlag,
    	Is_Member('DEFRUDARole') as Security_DataAdminFlag,
    	Is_Member('ARSAdminsRole') as Security_ARSAdminFlag,
    	Is_Member('ARSOnlineFormsURole') as Security_ARSOnlineFormsUpdateFlag
    From Users
    Where User_NTDomain + '\' + User_Login = sUser_sName()
    I am in SQL Server 2008 R2.

    Thanks in advance.
  • MLarsB
    New Member
    • Mar 2012
    • 10

    #2
    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!!!

    Comment

    Working...