Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Shahan Ayyub

@Shahan Ayyub
About
Posts
7
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XML to DataTable/DataGrid
    S Shahan Ayyub

    I have optimized the code a bit more, kindly check it out:

    Public Function XmlToDataTable(ByVal path As String) As DataTable
    Dim dt As New DataTable
    Dim doc As New XmlDocument()
    Dim PoNum As String = String.Empty
    Dim Header As String = String.Empty
    doc.Load(path)
    dt.Columns.Add("PoNum")
    dt.Columns.Add("Header")
    dt.Columns.Add("Line")
    dt.Columns.Add("Error")
    Dim cnt As Integer = doc.SelectNodes("Orders/OrderHeader").Count
    For k As Integer = 0 To cnt - 1
    Dim node As XmlNode = doc.SelectNodes("Orders/OrderHeader").Item(k)
    PoNum = node.Item("CustomerPoNumber").InnerText
    Header = node.Item("ErrorMessages").InnerText
    Dim n As Integer = doc.SelectNodes("Orders/OrderDetails").Count
    For m As Integer = 0 To n - 1
    Dim element As XmlNode = doc.SelectNodes("Orders/OrderDetails").Item(m)
    Dim obj(3) As Object
    obj(0) = PoNum : obj(1) = Header
    For Each stocks As XmlNode In element.ChildNodes
    Dim line As String = stocks.Item("Line").InnerText
    Dim description As String = stocks.Item("ErrorMessages").InnerXml.Replace("", " & ").Replace("", "").Replace("", "")
    obj(2) = line : obj(3) = description
    dt.Rows.Add(obj)
    Next
    Next
    Next
    Return dt
    End Function

    Visual Basic help xml

  • XML to DataTable/DataGrid
    S Shahan Ayyub

    Hi! Can you please provide few more sample(s) ? I have just created a method that do the job. I need to test it. It would be be great if it may have as many cases as you have.

    Visual Basic help xml

  • group by years
    S Shahan Ayyub

    The format you have provided for output, it seems that you want to use it in chart control? Is it right?

    Visual Basic database

  • group by years
    S Shahan Ayyub

    Have a look at this query:

    select SUM([total_sales]) as [Total], [Client],year([invoice_date]) as [InvoDate]
    FROM vanzari_totale
    group by [client], year([invoice_date])

    Visual Basic database

  • group by years
    S Shahan Ayyub

    Hi! Could you please check this one: ( without calling DatePart() )

    SELECT SUM(total_sales) AS year_1, Client
    FROM vanzari_totale
    GROUP by invoice_date, client

    Visual Basic database

  • Pattern
    S Shahan Ayyub

    It would be better for us if you could come up with some examples ? As I understood from your given information, this is required to you:

    ^\D{5}\-\d{6}_\D{1,}$

    So it should match with this kind of samples:

    aaaaa-666666_a

    Regular Expressions regex help

  • Regular Expression
    S Shahan Ayyub

    Have a look at this pattern: ^\d{3}[\s-]?\d{3}[\s-]?\d{4}$

    modified on Tuesday, August 23, 2011 8:35 PM

    Regular Expressions regex
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups