Solved

Problem with the codes

Posted on 2014-12-17
5
63 Views
Last Modified: 2014-12-19
Hi,
It did go to frmAddDB.Show() below
    Private Sub TxtIteID_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtIteID.LostFocus
        Dim Myconn As New OleDb.OleDbConnection
        Dim Objconfig As New Config
        If Me.TxtIteID.Text <> "" Then
            Try
                If ObjLogin.ValidID(Me.TxtIteID.Text) Then
                    With Me.cmbUnit
                        .Items.Clear()
                        For Each Dr As DataRow In ObjLogin.LoadBrIte(TxtIteID.Text).Rows
                            .Items.Add(Dr(0).ToString)
                        Next
                        .SelectedIndex = 0
                    End With
                Else
                    MsgBox("It is not Valid Iteid", MsgBoxStyle.OkOnly)
                End If
            Catch
                frmAddDB.Show()
            End Try
            ...

Open in new window

           
when running the project, while I've just put one ID to IteID Textbox, and I want to know why.
0
Comment
Question by:HuaMinChen
  • 3
  • 2
5 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 40506372
Is your question why line 18 is called?
If it is, then your code is raising an exception, the issue is you do not have enough details, thus please modify lines 17 to 20 as follows:
Catch ex As Exception
        ' Show the exception's message.
        MessageBox.Show(ex.Message)
        ' Show the stack trace, which is a list of methods 
        ' that are currently executing.
        MessageBox.Show("Stack Trace: " & vbCrLf & ex.StackTrace)
       frmAddDB.Show()
End Try

Open in new window

The first message box provide the exception reason (message) and the second message box the stack trace with location of the exception.
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40506401
Many thanks.

"PC326VM01\SSEXPR12" is the server name, which I use to login local Sql server DB, using management studio.

Is it fine that I put this below
<DBServer>PC326VM01\SSEXPR12</DBServer>
...

Open in new window


within Config.xml file fo the project?
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40506409
And I can use that name to login local Sql DB fine.
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40506476
Any other help to this?
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 40507985
Your last post is a new question, you should open a new question next time.
I am not sure how you are using DBServer element value,
for SQL server connection strings your post should be OK.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question