troubleshooting Question

Pull Data From Rectangular Array

Avatar of newimagent
newimagent asked on
.NET ProgrammingASP.NETVisual Basic.NET
6 Comments1 Solution351 ViewsLast Modified:
I have a prepopulated array(,) with version numbers and build numbers. I need to create code that looks up the build number (this is the value in smVersion) in the array and returns the version number.

        Dim Table1 As DataTable
        Table1 = New DataTable("SME")

        Dim Version As DataColumn = New DataColumn("Version")
        Version.DataType = System.Type.GetType("System.String")

        Dim Build As DataColumn = New DataColumn("Build")
        Build.DataType = System.Type.GetType("System.String")

        Dim Converter1 = Encoding.Convert(Encoding.Unicode, Encoding.Unicode, IO.File.ReadAllBytes(txtPath.Text & "\SMEInfo\SM_Exchange_Version_Info.log"))
        Dim ConvertedFile1 = System.Text.Encoding.Unicode.GetString(CType(Converter1, Byte())).Split(vbCrLf)
        Dim smVerInfo = (From j In ConvertedFile1 Where Not String.IsNullOrEmpty(j.Trim) Select j.Replace(" ", String.Empty).Trim).ToList
        Dim smVersion = From p In smVerInfo Where p.Contains("SnapManager®forMicrosoftExchange-") Select p.Replace("SnapManager®forMicrosoftExchange-", String.Empty).Trim
        Dim smBuild As String = ""
        Dim smBuilds As String(,) = {{"6.0.2", ""}, {"6.0P2", ""}, {"6.0P1", ""}, {"6.0D1", ""}, {"6.0", ""}, {"5.0P2", ""}, {"5.0P1", ""}, {"5.0", ""}, {"4.0P4", ""}}

        Dim Row1 As DataRow
            Row1 = Table1.NewRow()
            Row1.Item(Version) = smVersion(0)
            Row1.Item(Build) = smBuild
        Catch ex As Exception

        End Try

        gridSnapManager.DataSource = Table1

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros