.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

Problem writing xml

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
hi, I have wrote the code Dim doc As New XmlDocument() Dim xmlDeclaration As XmlDeclaration = doc.CreateXmlDeclaration("1.0", "utf-8", Nothing) doc.AppendChild(xmlDeclaration) Dim feed As XmlNode = doc.CreateElement("feed") Dim feedatt As XmlAttribute = doc.CreateAttribute("xmlns") feedatt.Value = "http://www.w3.org/2005/Atom" feed.Attributes.Append(feedatt) Dim feedatt1 As XmlAttribute = doc.CreateAttribute("xmlns:g") feedatt1.Value = "http://base.google.com/ns/1.0" feed.Attributes.Append(feedatt1) doc.AppendChild(feed) Dim entry As XmlNode = doc.CreateElement("entry") Dim title As XmlNode = doc.CreateElement("g:title") title.InnerText = "Hello World" entry.AppendChild(title) feed.AppendChild(entry) doc.Save(Server.MapPath("test.xml")) The output of this code is this <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> <entry> <title>Hello World</title> </entry> </feed>  As you can see in my code I wrote g:title but here it is title this is the problem why doesn't it make

View Complete Post

More Related Resource Links

Problem writing/deploying homemade webpart

I'm trying to add a homemade webpart to a page and I keep getting an error:"One of the properties of the Web Part has an incorrect format. Windows Sharepoint Services cannot deserialize the Web Part."

After getting this error I tried deploying a very simple webpart, but this one also gave the same error. Here is the source code for the webpart:

namespace MYWebParts

  [ToolboxData("<{0}:TestWP runat=server></{0}:TestWP>"),
    XmlRoot(Namespace = "MYWebParts")]

  class TestWP : Microsoft.SharePoint.WebPartPages.WebPart
    protected virtual void CreateControlHierarchy()
      Label bob = new Label();
      bob.Text = "BLAH BLAH BLAH";

    protected override void CreateChildControls()


Heres the dwp File:

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
	<Description>Test Web PArt</Description>
	<!-- Specify initial values for any additional base class or custom pr

problem in writing Element Path in Webservices has datsource for SSRS report



I have a requirement to create a webservice which returns dataset, once dataset is consumed by client application(here client app is SSRS report), I need to show dataset 's table value in SSRS rdl report.

When i see XML structure returned to client look like this

<?xml version="1.0" encoding="utf-8" ?>
<DataSet xmlns="http://tempuri.org/">
 <xs:schema id="Results" xmlns=""  
  <xs:element name="Results" msdata:IsDataSet="true"  
msdata:UseCurrentLocale="true" msprop:QueryTerms="Cool Bikes;"  
msprop:IgnoredNoiseWords="" msprop:Keyword="" msprop:ElapsedTime="938"  
msprop:Definition="" msprop:SpellingSuggestion="">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
     <xs:element name="RelevantResults"

Problem in Query Writing

declare @site table
 SiteId int

insert into @Site
select 100 union all
select 200 union all
select 300 

declare @Ticket table
	@TicketID int,
	@SiteID int

insert into @Ticket 
select 10,100 union all
select 20,200 union all
select 30,100 union all
select 40,300 union all
select 50,200 union all
select 60,100

declare @FeedBack table
	@FeedbackID int,
	@TicketID int,
	@CreationDate DateTime,
	@OutageTime DateTime,
	@ClearedTime DateTime
insert into @FeedBack
select 1,10,'10-21-2010 10:30:16.047','10-21-2010 20:23:00.000',NULL union all

select 2,20,'10-21-2010 11:30:16.047','10-21-2010 12:23:00.000',NULL union all

select 3,20,'10-21-2010 14:10:18.045',NULL,NULL union all

select 4,10,'10-21-2010 20:30:18.045',NULL,NULL union all

select 5,20,'10-21-2010 15:18.047',NULL,'10-21-2010 18:15.034' union all

select 6,10,'10-21-2010 22:16.047',NULL,'10-21-2010 23:15.034' union all

select 7,10,'10-21-2010 23:20.034','10-21-2010 23:22.035',NULL union all

select 8,10,'10-22-2010 01:02.002',NULL,'10-22-2010 02:03.004' 
I have 3 tables named FeedBack,Ticket and Site

The Feedback table depends on Ticket and Ticket Table Depends on Site

for one Site There may be Multiple Tickets and for one ticket there may be multiple feedbacks.

Here in the feedback table once an outage is happend for a Ticket then

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

10 Tips for Writing High-Performance Web Applications

Writing a Web application with ASP.NET is unbelievably easy. So easy, many developers don't take the time to structure their applications for great performance. In this article, I'm going to present 10 tips for writing high-performance Web apps. I'm not limiting my comments to ASP.NET applications because they are just one subset of Web applications. This article won't be the definitive guide for performance-tuning Web applications-an entire book could easily be devoted to that. Instead, think of this as a good place to start.

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Writing Custom Web Parts for SharePoint 2007

As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

XML Reading and Writing

We learned to process XML files using the Document Object Model as implemented by the XmlDocument class. To go further and make XML friendlier, the .NET Framework provides many other classes for different purposes, allowing you to create and manage nodes from custom .NET classes.
Besides the XmlDocument and the derived classes of XmlNode, the .NET Framework provides the XmlTextWriter class, which is derived from XmlWriter. The XmlTextWriter class works in a top-down approach to create, or deal with, the contents of an XML file. This class writes an XML node and moves down without referring

Writing Http Handlers and Modules in IIS 7.5

This article describes how Http modules and handlers are to be written and configured in IIS 7.5. The concept of a handler and module remains same, so dose there programming model. In this section we start off with the concept of a Http module and a Http handler, then talk about how to code them and finally describe the two methods available to configure them.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

RaiseEvent problem


I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.

UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.

First I created the sub delegate and event in UC1:

  • Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
  • Public Event Refresh_UC1 As MyRefresh

In the same UC1 the Insert procedure that fires the insert and RaiseEvent:

Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
       Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
       Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
       myCom.CommandText = "AddRow"
       myCom.CommandType = CommandType.StoredProcedure


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