Solved

Problem with the codes

Posted on 2014-12-17
5
62 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 35

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 35

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery - following an example but can I save data server side? 20 57
Expression Evaluater 3 37
VB.NET 2008 - SQL Timeout 9 34
Change to file doesn't show up 16 50
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

791 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