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")
        Table1.Columns.Add(Version)

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

        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.0.2.853"}, {"6.0P2", "6.0.1.750"}, {"6.0P1", "6.0.1.732"}, {"6.0D1", "6.0.0.708"}, {"6.0", "6.0.0.706"}, {"5.0P2", "5.0.0.208"}, {"5.0P1", "5.0.0.205"}, {"5.0", "5.0.0.186"}, {"4.0P4", "4.0.0.1307"}}

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

        End Try

        gridSnapManager.DataSource = Table1
        gridSnapManager.DataBind()
ASKER CERTIFIED SOLUTION
nepaluz

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