?
Solved

Problem with the codes

Posted on 2014-12-17
5
Medium Priority
?
68 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 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…
Suggested Courses

850 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