.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Parse XML in SQL

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :Sql Server
 

All,

I have a SQL table in 2008. There is a N_XML Column with XML Data Type, there are 3000 records that means 3000 Xml Documents in that Column. Now I need to parse that and get that data into another table or to display and make a report of it.

What might be the best possible way to parse and get the information out of it?

Thanks loadzzz

 




View Complete Post


More Related Resource Links

.NET GUI Bliss: Streamline Your Code and Simplify Localization Using an XML-Based GUI Language Parse

  

While Windows Forms in .NET has lots of cool features, if you're used to MFC, there are a couple of things you'll find missing, like doc/view, command routing, and UI update. The .NET answer to this is a code generator that writes new code for every single element. But there's a better way. In this article, Paul DiLascia shows how to develop an XML-based GUI language parser for .NET that lets you code resources, menus, toolbars, and status bars in XML instead of with procedural code. He also shows how a user interface based on XML can easily be localized using standard .NET techniques, and introduces his very own library, MotLib.NET, with lots of GUI goodies for your programming pleasure.

Paul DiLascia

MSDN Magazine November 2002


DateTime.Parse

  

Hi,

when i do something like this:

var time = DateTime.Parse("2010-01-03T17:08:33+01:00");

i get an object  of kind 'local' with the time set to 17:08:33, the extra hour is lost. Why does this happen and how can i fix it?

Actually the string representation of the time is received from a java web service and there is no way of changing the implementation of the service.


Thanks,

JMan


How do I get Decimal.Parse to stop taking current culture into account?

  
How do I get Decimal.Parse to stop taking current culture into account?   I tried the following but I get an error saying “String was not recognized as a valid DateTime.   Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");   Decimal.Parse("5000.000,51",CultureInfo.InvariantCulture)

Parse XML column using .Net

  
I tried to add a reference to Systm.XML.Linq to my Database Project.  It was not available to be added.  I need to parse an xml column in a table and populate certain fields that are stored as attributes and elements.  I would rather do this using Linq than the old way.  I am using VS2008 .net 3.5

JSON.parse error

  
Hi all, I am fairly new to asp.net and am just learning JSON.  I am trying to display a JSON result in a partial view, but I am getting the JSON.parse error.  I know I am getting the JSON response back - I can see it in Firebug and it must be in the correct format as I am getting the JSON tab and the data looks correct.  I am not sure what I am doing wrong.  Any help is very much appreciated. Thanks in advance, Donna Here's my code: The partial view:<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of IEnumerable (Of gmcps.StateItem))" %> <script type="text/javascript"> function getSalesRepInfo(e) { alert("state chosen is " + e.value); $.ajax({ type: "POST", url: "salesRepresentatives", data: ({ id: e.value }), dataType: "json", success: function (data) { var myObject = JSON.parse(data, function (key, value) { var type; if (value && typeof value === 'object') { type = value.type; if (typeof type === 'string' && typeof window[type] === 'function') {

Find text between two separate words - to parse text from a message

  
Hi all, I am new to regular expressions.   The following text has got three sections; - Name, Date, and Message   [Sender]: John Smith  [Received]: 2005-8-21 3:28:9Hi bob, thanks for the message[Sender]: Paul Stein  [Received]: 2005-8-21 3:17:38Cannot make that time...[Sender]: Sarah S  [Received]: 2005-8-20 15:18:2No way! Let me know if it's on. I would love to see that film. It got great reviews.[Sender]: John Smith  [Received]: 2005-8-21 3:28:9Hi bob, thanks for the message[Sender]: Paul Stein  [Received]: 2005-8-21 3:17:38Cannot make that time...[Sender]: Sarah S  [Received]: 2005-8-20 15:18:2No way! Let me know if it's on.   I want to extract each of them.   The text between "[Sender]:" and  "[Received]:" is the NAME   The next word after the  "[Received]:"  is the DATE   The MESSAGE starts after the digits of the Date end and it is upto the mark  "[Sender]:"   Can anyone tell me how to extract it using C# Regular expressions.   Thank you for your time.   Tomy

Is there a way to parse information in a word document and store them on a list (MOSS2007)? (Without

  
My current project requires me to parse through a Word document with tables that simulate a form. However Infopath isn't an available rescource for me. For example I'm to bring all information in the notes cell onto a list in sharepoint. Ultimately i'll be using a view to display that list through a webpart on a dashboard like interface on a sharepoint page. Is this possible? or is Info Path really the only way to go about this?

How do I parse/serialize when parent list element is missing?

  
First thank you ahead of time for you help. I really need some help with this. Background, this is to be a REST service in .net 4.0 and I understand I have to use xmlserializer instead of datacontract serializer. The xsd and the generated class assumes there can be one or more geo locations in a Locations element. However, based on an unchangable requirement, I have to assume the parent Locations element may not be there and the xml can contain only one child location element. So instead of <?xml version="1.0" encoding="UTF-8"?> <findService   xmlns="urn:ietf:params:xml:ns:lost1"   xmlns:p2="http://www.opengis.net/gml"   serviceBoundary="value"   recursive="true"> <Locations>   <location id="12334456" profile="geodetic-2d">     <p2:Point id="point1" srsName="urn:ogc:def:crs:EPSG::4326">       <p2:pos>40.85614955747385 -73.77044677734375</p2:pos>     </p2:Point>   </location> </Locations>   <service>urn:service:sos</service> </findService> they can send the following instead <?xml version="1.0" encoding="UTF-8"?> <findService   xmlns="urn:ietf:params:xml:ns:lost1&

dealing with nulls in a Int32.Parse(string) statement

  
How do I deal with null values in this section it throws errors when they leave the field blank it is a small order form and they don't have too add data to all the fields .   comm.Parameters.Add("@item_9223", System.Data.SqlDbType.Int);                comm.Parameters["@item_9223"].Value = Int32.Parse(txtitem_9223.Text);                comm.Parameters.Add("@item_9129", System.Data.SqlDbType.Int);                comm.Parameters["@item_9129"].Value = Int32.Parse(txtitem_9129.Text);                comm.Parameters.Add("@item_42795", System.Data.SqlDbType.Int);                comm.Parameters["@item_42795"].Value = Int32.Parse(txtitem_42795.Text);                comm.Parameters.Add("@item_30695", System.Data.SqlDbType.Int);                comm.Parameters["@item_30695"].Value = Int3

Load and parse a file where the file path is located in a column of a flat file source

  
Hi, I have a situation where I have a CSV that contains a bunch of data that populates a bunch of related tables with FK constraints directly.  Thats no problem.  The problem is that one of the columns specifies a filepath to an XML file that is supposed to contain data to be populated in a table with an FK constraint.  How do I specify the file name to the XML source component at runtime? For example TableA has columns: TableAID GroupName TableB has columns TableBID TableAID (FK to Table A) MemberID (the data in question) TableA has a 1 to many relationship with Table B. The CSV has a bunch of columns including: TableAID File path to list of members for each group. I don't know how to solve this problem.  I tried using a ForEach ... but I couldn't get it to work. Thanks in advance for any assistance.

parse the Select command in C#

  
Please i need to find all words starts with '@'  such as input parameter in sql query  ex:(select * from table where date=@enddate)ineed to get the enddate to view it in messageboxAlaa

Parse XML To build Dynamic Query

  
Hi All, I am trying to figure out the best way to handle a scenario where I will be passed XML that will contain criteria for a search. If the user has selected specific filters then those will be sent in the XML and if there is a section that they left unfiltered then it will not be present in the XML (Which would mean everything for that filter should be returned). My question is around the best process to shred the XML and build a dynamic query out of what i am getting out of the XML object. Is there a better way to handle this scenario? Here is my current approach: Shred the XML and put the filtered data into Global Temp Tables so that I can use them to build my dynamic query. Use those temp tables to create "Where Exists" Criteria within the query to filter down the results based on what was passed to me in XML. If one of the search criteria sections wasn't filtered the temp table would have zero rows and I wouldn't add that to the where clause with an exists statement. I used FOR XML PATH('') in the queries to roll up the data into comma separated values. Build the test schema / objects:   -------------------------------------------------------- --Build Test Schema to demonstrate XML Parsing -------------------------------------------------------- SET NOCOUNT ON; IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[test].[Products]

Youtube parse video

  
Can anyone write me the code differently than me ... I need urgently for my great project .. With this code, we filter out the error in "dim id as string = video.getattribute("id") and dim herf as string = video.getattribute("herf")...Txn

Dim HTMLDoc As IHTMLDocument2 = New HTMLDocumentClass
        HTMLDoc.write(Source)
        HTMLDoc.close()

        Dim BodyHTML As IHTMLElementCollection = HTMLDoc.body.all

        Dim URL As IHTMLElementCollection = BodyHTML.tags("A")
        Dim video As IHTMLElement
        For Each video In URL

            Dim id As String = video.getAttribute("id").ToString
            Dim href As String = video.getAttribute("href").ToString
            href = href.Substring(6)

            If id <> Nothing Then
&nb

[Sharepoint 2007]Parse error when I add code behind the page to a normal aspx page ?

  

Hi all,

I dont need this form to be embedded into Sharepoint. I am adding this webpage into Sharepoint because i has issues due to cross-domain permission. I cannot call refresh sharepoint from my op up window  webpage. Therefore i want to add my webpage into the same domain as sharepoint.

I have added the webpage aspx form into Sharepoint from the sharepoint designer 2007. I would like to add code behind the page too.

What i have done at the moment was to create a project in visual studio for the code behind the page. I folloed this article :

http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx

 

Then i have added the dll intothe bin of my sharepoint site. i have also added in webconfig the dll.

However i got the following error :

Parser Error Message: The codefile attribute on the page directive is not allowed in this page.

Source Error: 


Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormOragniseMeeting.aspx.cs" Inherits="FormOrganiseMeeting.FormOrganiseMeetingCodeBehind" %>
Line 2: 
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

Why

 

 

&nbs

problem with XamlReader Load/Parse image

  

I got error with this below:

string imageCompXaml = serialized image (bitmap)

Image imgObj = XamlReader.Parse(imageCompXaml) as Image

err: Property 'UriSource' or property 'StreamSource' must be set

i can workaround the problem by

  imgObj = new Image();
  imgObj.BeginInit();
  imgObj.Source = BitmapImageObject;
  imgObj.EndInit();

problem is by doing i missed out lot of other details.

I have a string, this is the serialized of the Image object, which is BitmapImage

I missed out the Image.prop details, like the width/height.

the image size is not same as the BitmapImage object, its a scaled/sized-down bitmap.

so using the 2nd Source workaround, i can't get back the actual image sizing (b4 serialize)

is there a way i can tackle at the XamlReader.Load/Parse() to resolve the err

or how to get back the image prop/details with my workaround?


problem with XamlReader Load/Parse image

  

I got error with this below:

string imageCompXaml = serialized image (bitmap)

Image imgObj = XamlReader.Parse(imageCompXaml) as Image

err: Property 'UriSource' or property 'StreamSource' must be set

i can workaround the problem by

  imgObj = new Image();
  imgObj.BeginInit();
  imgObj.Source = BitmapImageObject;
  imgObj.EndInit();

problem is by doing i missed out lot of other details.

I have a string, this is the serialized of the Image object, which is BitmapImage

I missed out the Image.prop details, like the width/height.

the image size is not same as the BitmapImage object, its a scaled/sized-down bitmap.

so using the 2nd Source workaround, i can't get back the actual image sizing (b4 serialize)

is there a way i can tackle at the XamlReader.Load/Parse() to resolve the err

or how to get back the image prop/details with my workaround?


problem parse xaml and blank spaces

  

Hi, I have a problem parsing an xaml with characters &#xD; and space blanks, the space that show me is different that show in Silverlight.

this is the code to parse the xaml

            xml_node = nodo.OuterXml;
            text = (System.Windows.Controls.TextBlock)XamlReader.Parse(xml_node);

            if (text.Height != double.NaN)
              text.Height = double.NaN;

            text.Text = text.Text.Replace(' ', (char)160);

            if (text.Visibility != Visibility.Collapsed)
              res.Children.Add(text);

And this is the code of xaml:

  <TextBlock x:Name="Elemento_300920102232365" Canvas.Left="121.488" Canvas.Top="125.682" Width="1705.799" Height="2169.455" Text="&#xD;&#xD;&#xD;Jamón de Bellota (reserva) / Pernil de Bellota (reserva)                         17'00 €&#xD;Anchoas del Cantábrico / Anchoves del Cantàbric  &

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend