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

Post New Web Links

TSQL Parsing RDL (XML)

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :


I am trying to parse a RDL in SQL Server 2005 to extract the data source and the stored procedure called by the report.  Can you please tell me how do I go about parsing out the values?

Thank you,


View Complete Post

More Related Resource Links

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

CLR Inside Out: Formatting and Parsing Time Intervals in the .NET Framework 4


Learn about enhanced TimeSpan formatting and parsing features coming in the .NET Framework 4, and some helpful tips for working with TimeSpan values.

Ron Petrusha

MSDN Magazine February 2010

Help parsing a string


Hi Everyone, I have the following string

strFullString = "<img src="http://image.weather.com/web/common/wxicons/31/32.gif?12122006" alt="" />Sunny, and 104 &deg; F. For more details?"  


What I would like to do is parse the full string into two strings with the following values

strImgSource = "http://image.weather.com/web/common/wxicons/31/32.gif"

strWeather = "Sunny, and 104 &deg; F."


Ive been pulling my hair out with this one, any help would be greatly appreciated. Thanks!

TSQL: Passing array/list/set to stored procedure (MS SQL Server)

Passing array/list/set to stored procedure is fairly common task when you are working with Databases. You can meet this when you want to filter some collection. Other case - it can be an import into database from extern sources. I will consider few solutions: creation of sql-query at server code, put set of parameters to sql stored procedure's parameter with next variants: parameters separated by comma, bulk insert, and at last table-valued parameters (it is most interesting approach, which we can use from MS SQL Server 2008). Ok, let's suppose that we have list of items and we need to filter this items by categories ("TV", "TV game device", "DVD-player") and by firms ("Firm 1", "Firm2", "Firm 3). It will look at database like this So we need a query which will return us list of items from database. Also we need opportunity to filter these items by categories or by firms. We will filter them by identifiers. Ok, we know the mission. How we will solve it? Most easy way, used by junior developers - it is creating SQL-instruction with C# code, it can be like this List<int> categories = new List<int>() { 1, 2, 3 };   StringBuilder sbSql = new StringBuilder(); sbSql.Append( @" select i.Name as ItemName, f.Name as FirmName, c.Name as CategoryName from Item i inner join Firm f on i.FirmId =

Approach using Regex in TSQL text manipulation

Hi there I have this following data: 0297144600-4799               0297485500-5599 The 0297485500-5599 based on observation always on position 31 char from the left which this is an easy approach. But I would like to do is to anticipate just in case the data is like this below which means the position is no longer valid: 0297144600-4799      0297485500-5599      0297485600-5699 As you can see, I guess the first approach will the split by 1 blank space (" ") but due to number of space is unknown (varies) how do I take this approach then? Is there any method to find the space in between and shrink into 1 blank space (" "). I am exploring Regex not sure how to do this and what I can think of is that if the blank is space can somehow reduce from xxx to 1 and I can handle this the rest. Thanks dewacorp.alliances

Parsing WSDL using ServiceDescription

Hi, I am trying to parse a wsdl file using the ServiceDescription class. I've been able to extract some information such as ports and messages. However, I am having trouble accessing the types described in the file. These are the types eclosed within the definitions element. <wsdl:types> <xsd:schema> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/http/"/> <xsd:complexType name="singleOutAddress"> <xsd:sequence> <xsd:element name="ReferenceID" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="AddressID" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="Score" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="Address" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="PostalCode" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <xsd:element name="ErrorCode" minOccurs="0" maxOccurs="1" type="xsd:string"> </xsd:element> <

Looking for TSQL statement that returns customers with greatest number of order in descending order

What would be an efficient TSQL SELECT statement that joins customer and order tables, counts the orders for each customer (group by) and returns a result for all customers with at least one order, and also in descending order from customers with the most orders to the least?

Server ERROR: An error occurred during the parsing of a resource required to service this request.

I have created one asp.net 2.0 application and created a setup project. I run this setup in my local machine, the application run fine, but i uploaded into online server I met the following parser error.How to solve this error? Kindly help me. Very urgent.. Kamal....

XQeury in TSQL

Why can i use it like this: SET @xml.modify(' delete if(/employees/employee/name[sql:variable("@index")][contains(.,@type)]) then (/employees/employee/name[sql:variable("@index")]/@type) else() ') but can not use it like this: SET @xml.modify(' insert attribute type {string("Normal")} as first into (/employees/employee/name)[sql:variable("@index")] ')

Need help parsing out a datestamp

Hi folks, I'm trying to parse a datestamp (that I got from Twitter) but am receiving errors. here's the datestamp: Fri, 27 Aug 2010 22:00:07 +0000 Here's my code: DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US")) and here's my error: System.FormatException was unhandled   Message=String was not recognized as a valid DateTime. Anyone fancy taking that on? To make it easy I've provided the code below for a console app that exhibits the problem.   Thanks Jamie using System; using System.Globalization; class Program { static void Main(string[] args) { string MyDateValue = "Fri, 27 Aug 2010 22:00:07 +0000"; var dt = DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US")); } } http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me


this particular query takes the tototal execution time of 20 minutes and 52 seconds is there any posibilities to make this particular query faster? select   state_name,dist_name,tahsil_name,isnull(sum(CASE WHEN T_rabbit.Village_code like '0%' and T_rabbit.sb_code between 1401 and 1405 then rm end ),0)as rm,isnull(sum(CASE WHEN T_rabbit.Village_code like '0%' and T_rabbit.sb_code between 1401 and 1405 then rf end ),0)as rf,isnull(sum(CASE WHEN T_rabbit.Village_code like '0%' and T_rabbit.sb_code between 1401 and 1405 then rm+rf end ),0)as TotalRabbit,isnull(sum(CASE WHEN T_Dog.Village_code like '0%' and T_Dog.sb_code ='1300' then dm end ),0)as dm,isnull(sum(CASE WHEN T_Dog.Village_code like '0%' and T_Dog.sb_code ='1300' then df end ),0)as df,isnull(sum(CASE WHEN T_Dog.Village_code like '0%' and T_Dog.sb_code ='1300' then dm+df end ),0)as TotalDog,isnull(sum(CASE WHEN T_Elephant.Village_code like '0%' and T_Elephant.sb_code ='1500' then em end ),0)as em,isnull(sum(CASE WHEN T_Elephant.Village_code like '0%' and T_Elephant.sb_code ='1500' then ef end ),0)as ef,isnull(sum(CASE WHEN T_Elephant.Village_code like '0%' and T_Elephant.sb_code ='1500' then em+ef end ),0)as TotalElephant from state_master inner   join dist_Master ON Dist_Master.State_code=state_master.State_code INNER   JOIN Tahsil_Master ON Tahs

XQuery in TSQL

Why can i use it like this:   SET @xml.modify(' delete if(/employees/employee/name[sql:variable("@index")][contains(.,@type)]) then (/employees/employee/name[sql:variable("@index")]/@type) else() ')   but can not use it like this:   SET @xml.modify(' insert attribute type {string("Normal")} as first into (/employees/employee/name)[sql:variable("@index")] ')  

parsing weather channel xml file using linq

 Hi I never used linq before and i'm having trouble parsing the xml file at  http://xoap.weather.com/search/search?where=" + strCityName.ToString(); I used to use a dataset but since trying to change my site to mvc, i thought i would use linq to xml, but after 2 days have still not found success. i have a class called: public class WeatherCityBLLModel { public string loc { get; set; } public string loc_id { get; set; } } and then a class called public class WeatherCityDALModel { public static List<WeatherCityBLLModel> GetLocation(string strCityName) { XDocument doc = XDocument.Load("http://xoap.weather.com/search/search?where=" + strCityName.ToString()) return doc; <<< Does not work } } How do i get the data from xoap.weather and pass it to my controller Any help appreciatedGeorge        

XML Parsing Error: no element found

I had an old SQL server  2008 instance removed and reinstalled SQL server, SSAS, SSRS all together.   When trying to log onto Report Server, I am seeing following error.  can you hel? thanks     XML Parsing Error: no element found Location: http://myservername:8080/Reports/Pages/Folder.aspx Line Number 1, Column 1:

A tsql report with multiple counts and pivioted description attributes

Hello,   I have an assignment in which I am to prepare a report displayed in excel to return counts of various attributes in the database. However, the count is a bit challenging because it requires counting certain attributes in a pivot format illustrated below. The counts for each category by recruiter, rolled up by Division, within the specified time frame.   The tables that I would have to deal with are as follows:   User: Has the number of Accounts…user accounts with no Recruiter are unassigned Recruiter: Has the recruiter information LoginHistory: Has a record of all logins EForm: Has the various forms, for example: Release and Authorization, Provider Service Agreement EFormUserXref: You can filter it to return the Physican AppForms                                                                       Surgery                                      &n

Parsing a SQL query

I am trying to parse a SQL select query.  The idea is to pull out the field names in the query to use them in a lookup to get the units for each field.    The problem is that I need to put units on the columns, but do not know in advance which fields are being queried.  People can type in a free hand query using the field names, "as", "sum(field)", "count(field)", etc.    I am new to regular expressions.  Has anyone done anything like this, or could point me to an example that I could use to get started?   Any help would be great.   Thanks.   David

Report Level Security in SSRS using Tsql

So i am Brand new in this area i have developed reports before and deployed them but never got an oppurtunity to work on security and who gets to see what.. Purpose of the view is thats what im thinking..   We have a reports database has 100 reports . What we are trying to do is have a faster way to manage report subscriptions. The tables i have is Analysts, SalesRep,SalesRepSubs and dbo.users.Dbo users are our web portal users where they can view reports. I want to create a table in which every report is viewed per security level. We have 6 layers of security layer 1 is lowers to layer 6 being highest. This is the relationship between tables Salesrep(SRID PK) Salesrep_sub (SRID_SUBID PK) Analysts : (AnalystIDPK) Users: The Table has all Users who are Salesrep,Sales Repsub and Analysts)(PKID PK) and we have cols SRID, SRID_SUBID & AnalystID) in this table. use Pricing go Alter View dbo.User_Access   AS select S.SR_name,u.SRID,sr.SRsub_name,u.SRID_SubID,U.Userid,u.username,u.Email, u.SecurityLevel,a.AnalystID from dbo.Users u join tbl_Analyst a on a.AnalystID=u.UserID join tbl_SalesRep s on s.SRID=u.SRID Join tbl_SalesRep_Sub sr on sr.SRID_SubID=u.SRID_SubID My question is what do i do next? Add this view to Report server? or how can i make it functionl?????????FM
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