Click here to Skip to main content
14,429,492 members
Rate this:
Please Sign up or sign in to vote.
See more:
i want to read my xml with child node to sql database
Posted
Comments
Orcun Iyigun 15-Dec-11 14:07pm
   
Go ahead what is avoiding you do this? That's not even a question. You better read http://www.codeproject.com/KB/FAQs/Questions-and-Answers.aspx#rules[^]
Mohamed Ahmed Abdullah 15-Dec-11 14:46pm
   
http://www.codeproject.com/KB/cs/ResxMergeUtility.aspx
http://www.codeproject.com/KB/vista/LINQ_3.aspx
http://www.codeproject.com/KB/XML/XMLAlphabetizer.aspx

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Quote:


Dim xDoc = XDocument.Load(feedUrl)

'For Each category In xDoc.Descendants("category")

' ' Try

' Dim lName As String = category.Attribute("name").Value
' Dim leagueName() As String
' leagueName = Split(lName, ":", 2)

' Dim leagueId As String = category.Attribute("id").Value


' Dim minutesToExpiry As Int16 = 5
' For Each match In xDoc.Descendants("match")

' 'Try
' Dim matchId As Integer = Val(match.Attribute("id").Value)
' Dim matchDate As DateTime = CDate(String.Format("{0}/{1}/{2} {3}", _
' match.Attribute("date").Value.Split(" ")(1), _
' match.Attribute("date").Value.Split(" ")(0), _
' match.Attribute("formatted_date").Value.Split(".")(2), _
' match.Attribute("time").Value))
' matchDate = matchDate.AddHours(1) ' GMT + 1

' Dim match_formdate As Date = match.Attribute("formatted_date").Value
' Dim match_time As Date = match.Attribute("time").Value
' Dim gsm_id As Integer = match.Attribute("fix_id").Value
' Dim matchStatus As String = match.Attribute("status")
' Dim homeId As String = match.Descendants("localteam")(0).Attribute("id").Value
' If homeId = "" Then
' homeId = 0
' End If

' Dim homeTeamId As Integer = CInt(homeId)
' Dim homeTeam As String = match.Descendants("localteam")(0).Attribute("name").Value

' Dim awayId As String = match.Descendants("visitorteam")(0).Attribute("id").Value
' If awayId = "" Then
' awayId = 0
' End If
' Dim awayTeamId As Integer = CInt(awayId)
' Dim awayTeam As String = match.Descendants("visitorteam")(0).Attribute("name").Value

' Dim uniqueId As String = String.Format("{0:yyyyMMddHHss}{1}{2}", matchDate, homeTeamId, awayTeamId)
' Dim expiryDate As DateTime = matchDate.AddMinutes(-1 * minutesToExpiry)

' Dim entby As String = "user"
' If match.Descendants("localteam")(0).Attribute("goals").Value.Length > 0 Then

' Dim homeTeamScor As String = match.Descendants("localteam")(0).Attribute("goals").Value
' Dim awayTeamScor As String = match.Descendants("visitorteam")(0).Attribute("goals").Value

' If homeTeamScor = "?" Then
' homeTeamScor = "0"
' End If
' If awayTeamScor = "?" Then
' awayTeamScor = "0"
' End If
' homeTeamScore = CInt(homeTeamScor)
' awayTeamScore = CInt(awayTeamScor)
' End If

' If match.Descendants("events").Elements.Count > 0 Then

' End If
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100