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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

for xml path output - empty tags should be

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
here's tha sample code:
'alpha' _name,
'alp333' _username
for xml path('), type),
(select ccy, acc  from #samp
for xml path('), type)
for xml path('ccyXML'),elements
current output:
    <acc />
    <acc />

View Complete Post

More Related Resource Links

JPEGS with empty IPTC / APP14 Tags cause GDI+ error

I am curious as to why the GDI+ libraries error our with exc = {"A generic error occurred in GDI+."} when the IPTC headers are empty.  I would assume it should reasonably take care of this.  I have taken am image and changed the "ff ed" app14 marker to more generic "ff ec" and everything loads fine and dandy.  So by analysis I am looking at a jpg the IPTC header has no data and I am guessing the GDI+ libraries dont handle empty data very well.  Anyone else having this problem.  Only workaround which is expensive is creating a new image and saving it to the stream which in a sense basically strips the header data making it more generic of an image.   System.Drawing.Image image = Image.FromFile("c:\\test6.jpg"); System.Drawing.Image image2 = null; ImageFormat format = ImageFormat.Jpeg; using (var stream = new MemoryStream()) { try { image.Save(stream, format); //using jpg with empty IPTC data will throw GDI+ error } catch (Exception exc) { image2 = new Bitmap(image);//this is expensive but gets job done image2.Save(stream, format); } context.HttpContext.Response.BinaryWrite(stream.ToArray()); } JPG Hex Bytes from beginning of file.  The Internal of the stream will error out about 24 bytes with a lengt

How to detect empty element closing tags in XmlTextReader?

How do I detect the closure of an element in the form of <foo  stuff.stuff.stuff   />   ?

In this (Microsoft generated) XAML fragment  . . .

<Window x:Class="WpfXml2.Window1"
    Title="Window1" Height="372.185" Width="613.272">
    <Grid Width="534.391">
        <ListBox Margin="41,66,37,11.891" Name="listBox1" FontFamily="Ariel" FontSize="12" />
        <Label Height="24.442" HorizontalAlignment="Right" Margin="0,23.331,105.545,0" Name="label1" VerticalAlignment="Top" Width="120">Label</Label>

. . .

Using MoveToElement() when I get to the start of Listbox it has a NodeType of "Element" and a Name of "Listbox"  (as I expected)  On the next MoveToElement() it shows a NodeType of "Whitespace" and IsEmpt

need html tags to be removed from output text



i have some code written in c# to obtain the text and numbers from a web interface that required user inputs.

my problem is that the texts i am getting off the web is displays in html forms (i.e. it has tags all over the place)

hence, i would like to filter out the html tags, is that possible?

i searched up some codes but it didn't help me as it brought up even more problems when compile.

any helps is greatly appriciated.

FOR XML PATH and WITH XMLNAMESPACES - how do I NOT output a Namespace Reference for some PATHs?

I have an SQL Server 2005 query, that uses FOR XML PATH... to output the XML. Due to the complexity of the XML being output, I use correlated subqueries to output portions of the XML. Each subquery uses FOR XML PATH... to output composites within that 'chunk' of the XML. This works fine, i.e. the XML is output as I expect it to be/as I need it to be. We also need to use namespaces for some tags. The namespaces work as well - except that the references for the namespaces seem to be output within every composite defined within every FOR XML PATH... statement. I want the references only output within the 'top' or 'root' xml tag/composite, instead of every tag/composite defined within a PATH('...') option somewhere. Another way to say that is, I only want the Namespace references output for the PATH defined within the query itself, NOT for any PATHs defined within subqueries. An example from the query itself is: SELECT ( SELECT PhoneNumber AS '@communicationNumber', 'TELEPHONE' AS '@communicationChannelCode' FROM TableName tn3 WHERE tn3.ID = tn1.ID FOR XML PATH('communicationChannel'), TYPE ), ( SELECT FaxNumber AS '@communicationNumber', 'TELEFAX' AS '@communicationChannelCode' FROM TableName tn2 WHERE tn2.ID = tn1.ID FOR XML PATH('communicationChannel'), TYPE ), 'EN' AS 'personOrDepartme

How to Customize the Add Comment 'Items on this list require content approval...' notification in


WSS 3.0:

If content approval is turned on, the Add Comment section displays a fairly ugly notification. Is there any way I can customize that section through e.g. CSS or SPDesigner?

I'd like to change at least the text, and preferably the yellow exclamation image, and also the background if possible.

Solved: LDAP authentication: error code 49 - 80090308, comment: AcceptSecurityContext error, data 52

Hi, I have a problem conneting to another domain (far.away.domain). We have a two-way trust to this domain. Also I can access the DS using ADSI edit and our Administrator account (ourdomain.com). I tried several types of credentials (userid = "CN=Administrator,CN=Users,DC=ourdomain,DC=com", "Administrator @ ourdomain.com" (without blanks)...). Connecting to ourdomain.com is no problem, but to far.away.domain I can't connect, I always get the error 525 (user not found). What could be the problem? Have I to use an entry from the ForeignSecurityPrincipals CN of the far.away.domain? I also tried to connect using Softerra LDAPBrowser and a command line ldapsearch without succes and with not a better error message. But why is it not possible to use a trusted account, or is this a active directory feature and does not work with pure LDAP bindings? Best regards, Nils.

internet explorer closes. I can't get my e-mail to open a comment from facebook

when I try to open my internet explorer it either won't open at all or it workd for awhile then it crashes. I was able to open my yahoo mail and open facebook comments from the yahoo e-mail but it never connects 

Problem with conditional comment

I have this conditional comment that is used to call a different style sheet for IE7.  I can't figure out why it won't work though.Everything seems to be right.  The file name and path for the IE 7 style sheet are correct.  This has been proven because the other style sheet works and it's in the same folder.Does anyone see what is wrong with it?<head runat="server"> <title></title> <!--[if IE 7]><link href="styles/styles_ie7.css" rel="stylesheet" type="text/css"><![endif]--> <link href="styles/styles.css" rel="stylesheet" type="text/css" /> <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder> </head>

Can Not Comment On images stored in the picture libraray(created in profile location )

Hi, I have created a picture library in the profile location (under the location where person.aspx is available) I want to achieve social comment on the images stored under profile location I am displaying it on a page using object model Can any one please help me....

A SOA based Customizable Data Access Layer.Please comment

Hi, Actually I have an idea  to built a reusable package software .. The detail mentioned below.. ------------------------------------------------------------------------------------------ A SOA based Customizable Data Access Layer. Data access layer (DAL) is an essential part of almost every project. A data access layer can be build with all required methods(Like methods for fetching, inserting, updating data and also other methods can be built with required number of input parameters, which execute stored procedures.) in any language. Interfacing with the DAL would be a webservice. A webservice can be build with webmethods. The web service contains all web methods, which call all the methods in DAL, passing the appropriate parameters. Addition to those methods, webservice contains a method which takes database details as input parameters and passes the parameters to the method in DAL, which makes connection with database. Thus, the DAL layer and webservice, as a whole are acting as a complete package If the DAL and webservice can be built one time, it can be reused in any project with out modifying it.As the webservice is platform independent and language independent, any project can access the project/software for data operation. Using this product time can be saved so, deadline can be met easily. If this product is developed one time and can be reused by sever

posting a comment

hi guys,in my asp.net website i have no memebrship or sql (authentication mode=none)  however on some pages i need to allowvisitor to leave a comment.i have the following form:post a comment , name textbox, comment textbox, and a button called post...what event handler i shld create for the buttom, and how do i dissplayer the comments above each other with a date of each comm?

Using the social comment note board in a web part page results in incomplete URL



If I create a wiki page and add the note board webpart, then construct a URL for the page which contains a parameter (ie.  home.aspx?tn=1), and add a note, then that note will only display if the "?tn=1" parameter is included in the URL.

However, if instead I use a web part page, (and leave the URL for Notes property blank) the Note Board ignores the parameter in the URL.   I can add the full url with parameters in the "URL for Notes" property for the web part, and it will store and retrieve properly.   

I want to use a web part page with a Note Board web part,  but have it act like the wiki page when saving notes to specific URLs, including parameters.  Is there a work around for this?


Anonymous user to comment on post, does not allow anonymous user to view pending post SharePoint 201


I have created a Blog site using SharePoint Foundation 2010 , I made allow anonymous access to this site 

and i also made anonymous user to Comment on the Post and View the comment for the Post .  

http://<server_name>/Blog/Default.aspx  this is the default Page were we can see all the Post ..

When i Click on the Comment http://<server_name>/Blog/Lists/Posts/Post.aspx?ID=1 i am redirected to this page 

I have also allowed content approval for the Comment Submitted by the anonymous user 

but the Problem is that Anonymous user can see all the Comment for that particular post before approved.

Please help for this...

Comment functionality on Blog Pages


Currently I am using ASP.Net MVC to create a blog from scratch and everything has gone well so far. I am not running into a snag I am not sure how to fix. I am using C#.

So I have blog posts displaying properly but I want to add comment functionality. When I grab the blog post I want to also grab all the comments associated with that blogid. I have implemented a join on my LINQ statement but am not sure how to display it on the view page.

Here is what I have in the controller I would like to know how I would display the comments on the view.

public ActionResult Details(string friendlyURL)
            var blog = from b in _db.Blogs where b.FriendlyURL == friendlyURL
                        join c in _db.Comments on b.id equals c.BlogID
                        select new { b, c };
            return View(blog);

Altering the Social Comment Web Part


Hey all,


I'm trying to alter the Social Comment web part, i'd like to change the text inside it ideally, but i'd maybe settle for some styling - i can't seem to get hold of any of the XSLT that makes it work, it all seems so locked down - is there any way at all to do this?

Many thanks,



ASP.NET Comment Box


I have a website that is selfhost by me using IIS 5.1 and I whould like to have a comment box in my web site.

I do not have IIS setup for php and I whould like to avoid AJAX but I will do it if I have to.

My web site is setup for asp.net 4 and only that.

I whould like this to be self code so some kind of tutorial that use what know which is html, asp.net, and some javascript whould be nice.

Multiline comment in VB.NET


Is there a multiline comment in VB.NET besides '?


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