Click here to Skip to main content
15,900,725 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to flip the screen using .net Pin
aismangalore13-Jan-06 4:38
aismangalore13-Jan-06 4:38 
AnswerRe: how to flip the screen using .net Pin
Dave Kreskowiak13-Jan-06 5:24
mveDave Kreskowiak13-Jan-06 5:24 
QuestionInteractive voice operating system Pin
Osama12313-Jan-06 4:08
Osama12313-Jan-06 4:08 
AnswerRe: Interactive voice operating system Pin
Dave Kreskowiak13-Jan-06 4:14
mveDave Kreskowiak13-Jan-06 4:14 
QuestionUsing utf-8 for superscript 4 and showing in combobox Pin
Fawxes13-Jan-06 2:02
Fawxes13-Jan-06 2:02 
AnswerRe: Using utf-8 for superscript 4 and showing in combobox Pin
Guffa13-Jan-06 2:17
Guffa13-Jan-06 2:17 
GeneralRe: Using utf-8 for superscript 4 and showing in combobox Pin
Fawxes13-Jan-06 2:28
Fawxes13-Jan-06 2:28 
GeneralRe: Using utf-8 for superscript 4 and showing in combobox Pin
Fawxes13-Jan-06 2:33
Fawxes13-Jan-06 2:33 
Put this in seperate message to reduce message size.

<br />
Public Sub PopulateFromXML(ByVal fileName As String)<br />
<br />
        'Collect the path for the dll<br />
        Dim path As String<br />
        path = System.Environment.GetFolderPath( _<br />
                            Environment.SpecialFolder.CommonApplicationData)<br />
<br />
        'Read the xml file into a dataset<br />
        Dim xmlFile As New System.Data.DataSet<br />
        xmlFile.ReadXml(path & _<br />
                            System.IO.Path.DirectorySeparatorChar & _<br />
                                "Flowguard Limited " & _<br />
                                    System.IO.Path.DirectorySeparatorChar & _<br />
                                        "Engineering Dimensions" & _<br />
                                            System.IO.Path.DirectorySeparatorChar & _<br />
                                                fileName)<br />
<br />
        'Collect the unit type<br />
        Dim unitType As String<br />
        unitType = Convert.ToString(xmlFile.Tables("DimensionUnits").Rows(0).Item("Type"))<br />
<br />
        'Collect the units table<br />
        Dim unitsTable As New System.Data.DataTable<br />
        unitsTable = xmlFile.Tables("Unit")<br />
<br />
        'Loop through each row of the units table, adding a new unit each time<br />
        Dim rowEnum As IEnumerator<br />
        rowEnum = unitsTable.Rows.GetEnumerator<br />
<br />
        While rowEnum.MoveNext<br />
            'Cast the enumerated object to a data row<br />
            Dim currRow As DataRow<br />
            currRow = CType(rowEnum.Current, System.Data.DataRow)<br />
            'Create a new unit object<br />
            Try<br />
                Dim newUnit As New Unit(Convert.ToString(currRow("Name")), _<br />
                                            Convert.ToString(currRow("Abbreviation")), _<br />
                                            Convert.ToDouble(currRow("Factor")), _<br />
                                            Convert.ToBoolean(currRow("IsMetric")), _<br />
                                            Convert.ToBoolean(currRow("IsSIUnit")), _<br />
                                            "Length")<br />
<br />
                'Add the unit to the collection<br />
                Me.Add(newUnit)<br />
            Catch formatEx As System.FormatException<br />
                'Provide a message string<br />
                Dim origString As String = "There is a problem in the xml file "<br />
                Dim msgString As String = ""<br />
<br />
                'Identify which value has the problem<br />
                If Not (TypeOf (currRow("Name")) Is String) Then<br />
                    If msgString.Length = 0 Then<br />
                        msgString = origString & " with the Name Field"<br />
                    Else<br />
                        msgString += ", the Name Field"<br />
                    End If<br />
                End If<br />
<br />
                If Not (TypeOf (currRow("Abbreviation")) Is String) Then<br />
                    If msgString.Length = 0 Then<br />
                        msgString = origString & " with the Abbreviation Field"<br />
                    Else<br />
                        msgString += ", the Abbreviation Field"<br />
                    End If<br />
                End If<br />
<br />
                If Not (TypeOf (currRow("Factor")) Is Double) Then<br />
                    If msgString.Length = 0 Then<br />
                        msgString = origString & " with the Factor Field"<br />
                    Else<br />
                        msgString += ", the Factor Field"<br />
                    End If<br />
                End If<br />
<br />
                If Not (TypeOf (currRow("IsMetric")) Is Boolean) Then<br />
                    If msgString.Length = 0 Then<br />
                        msgString = origString & " with the IsMetric Field"<br />
                    Else<br />
                        msgString += ", the IsMetric Field"<br />
                    End If<br />
                End If<br />
<br />
                If Not (TypeOf (currRow("IsSIUnit")) Is Boolean) Then<br />
                    If msgString.Length = 0 Then<br />
                        msgString = origString & " with the IsSIUnit Field"<br />
                    Else<br />
                        msgString += ", the IsSIUnit Field"<br />
                    End If<br />
                End If<br />
<br />
                'Inform the user<br />
                System.Windows.Forms.MessageBox.Show( _<br />
                                msgString, "XML File Error!", _<br />
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation)<br />
            Catch ex As System.Exception<br />
                'Throw the exception<br />
                Throw ex<br />
            End Try<br />
<br />
        End While<br />
<br />
        'Raise the list changed event<br />
        RaiseEvent ListChanged(Me, _<br />
                        New System.ComponentModel.ListChangedEventArgs( _<br />
                            System.ComponentModel.ListChangedType.Reset, 0))<br />
<br />
    End Sub 'PopulateFromXML<br />


An optimist's glass is half full.
A pesimist's glass is half empty.
An engineer goes and gets the right size glass.
AnswerRe: Using utf-8 for superscript 4 and showing in combobox Pin
Guffa16-Jan-06 3:27
Guffa16-Jan-06 3:27 
GeneralRe: Using utf-8 for superscript 4 and showing in combobox Pin
Fawxes16-Jan-06 5:05
Fawxes16-Jan-06 5:05 
Questionlooking for a cad file viewer component... Pin
freesites13-Jan-06 0:48
freesites13-Jan-06 0:48 
AnswerRe: looking for a cad file viewer component... Pin
Fawxes13-Jan-06 2:36
Fawxes13-Jan-06 2:36 
AnswerRe: looking for a cad file viewer component... Pin
jonathan1513-Jan-06 2:53
jonathan1513-Jan-06 2:53 
Questionhow to know which port is open Pin
Paritos12-Jan-06 23:35
Paritos12-Jan-06 23:35 
AnswerRe: how to know which port is open Pin
Dave Kreskowiak13-Jan-06 4:13
mveDave Kreskowiak13-Jan-06 4:13 
QuestionSystem.Net.Mail.MailMessage + Signature Pin
capitan_cavernicola12-Jan-06 23:34
capitan_cavernicola12-Jan-06 23:34 
AnswerRe: System.Net.Mail.MailMessage + Signature Pin
capitan_cavernicola20-Jan-06 4:14
capitan_cavernicola20-Jan-06 4:14 
Questionactual datagrid column width Pin
Lonzo12-Jan-06 22:50
Lonzo12-Jan-06 22:50 
AnswerRe: actual datagrid column width Pin
Dean_SF13-Jan-06 8:35
Dean_SF13-Jan-06 8:35 
QuestionOutlook programming Pin
Anil_vvs12-Jan-06 22:06
Anil_vvs12-Jan-06 22:06 
QuestionComboBox in DataGrid problem ! Pin
thaohoph12-Jan-06 21:39
thaohoph12-Jan-06 21:39 
QuestionAny Body Can Help Me with ODBC Pin
Swiss Mantoro12-Jan-06 21:31
Swiss Mantoro12-Jan-06 21:31 
AnswerRe: Any Body Can Help Me with ODBC Pin
Arthur van der Merwe13-Jan-06 2:53
Arthur van der Merwe13-Jan-06 2:53 
GeneralRe: Any Body Can Help Me with ODBC Pin
Swiss Mantoro15-Jan-06 22:55
Swiss Mantoro15-Jan-06 22:55 
QuestionInstalled MS Office, how to show document in window form? Pin
cylix200012-Jan-06 20:40
cylix200012-Jan-06 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.