Solved

Problem with the codes

Posted on 2014-12-17
5
64 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 11

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 11

Author Comment

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

705 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