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

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

SQL XML Replacing(Updating) with condition

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


I need a doubt in sql server xml

Sample XML


<Name =”Chennai” Rank=”5” />

<Name=”Pune”  Rank=”4” />

<Name=”Bangalore” Rank=2” />



I extract this xml through for xml in sqlse

View Complete Post

More Related Resource Links

Replacing/Updating Files using WSP


I'm trying to replace/overwrite the ItemStyle.xsl file using a WSP.  I can create a new file in the Style Library/XSL Style Sheets folder just fine using this method.  I just can't figure out how to update any file that already exists.  In the example below, the new file ItemStyle2.xsl gets created in the folder, but the ItemStyle.xsl doesn't get updated.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <Module Name="Style Library" Url="Style Library/XSL Style Sheets" Path="Style Library/XSL Style Sheets">
  <File Url="ItemStyle.xsl" Type="GhostableInLibrary" />
  <File Url="ItemStyle2.xsl" Type="GhostableInLibrary" />

Any Help would be greatly appreciated.  Thanks!

Nick Hurst

replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.


i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.

Error when updating. Supposedly updating ID without being asked.



Server Error in '/' Application.

Value of member 'ID' of an object of type 'Ref' changed.
A member defining the identity of the object cannot be changed.
Consider adding a new object with new identity and deleting the existing one instead.

I get this error whenever I attempt to update an entry. Even an entry that has had nothing altered. I have tried to circumvent it but I think it must be a simple oversight. How could I have caused an ID update using the Edit.aspx page of dynamic data? Thank you in advance for the help!

how to multiple condition in if statement in asp.net C#



i am using if condition to find out a time

if(time=="08 AM)


response.write"shift A";


but problem is how can i put multiple condition in if like

if(time=="06 AM" and "08 AM" and "07 AM")

Data Points: Updating Data in Linked Servers, Information Schema Views, and More


Every day a developer somewhere needs to write code to iterate through SQL ServerT system objects, query and update tables in linked servers, handle optimistic concurrency, and retrieve column and stored procedure metadata.

John Papa

MSDN Magazine November 2004

Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows


The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004

BITS: Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API


Both the .NET Framework and Windows have some very interesting APIs for creating applications that are capable of updating themselves automatically over a network. There are many advantages to writing your application to update itself like Windows Update does, including convenience for your users, from easier maintenance to network administration. Automatic updates require attention to factors such as discovery, security, and file replacement. In this article, the author covers the BITS API as well as a number of features of the .NET Framework that take care of these facets of auto-updating using the same facilities that the Windows Update uses.

Jason Clark

MSDN Magazine February 2003

Roles not updating


I have all my code in my other post about checkboxlist issue, but it boils down to, once i find someone doing my search, it displays their permissions as checkboxes. But if i want to remove a permission and click update, the update doesnt seem to occur, if i search on myself, it returns me with my permissions already checked. I uncheck 1 permission, click update and the checkbox is checked again as the page posts.

Original Post:

My aspx page seems pretty simple:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>Enter UserName: 
        <asp:TextBox ID="TxtUserName" runat="server" /><asp:Button ID="LookupBtn" runat="server" Text="Search" onclick="LookupBtn_Click" />  
    <div class="roleList">
        <asp:CheckBoxList ID="RoleList" runat="server" /><br />
        <asp:button ID="UpdateBtn" text="Update" Visible="false" runat="server" onclick="UpdateBtn_Click" />

My update button event and update method:

Stored Procedures & SqlDataAdapter not updating a calendar control


Hi all,

I have a database linked to a calendar. I had a peice of code that retrieved dates from a database and populated the calendar. I wanted to tidy up my code using stored procedures (they seem neater & i assume there's a benefit somewhere). so i came up with this, however it's not working. The calendar displays, but it's not being populated with the database entries. The SqlCommand & SqlParameter I have working elsewhere in my code; as with the SqlDataAdapter (which also worked before i tried to conver to a stored procedure!) but combining these three (SqlCommand, SqlParameter & SqlDataAdapter) seem to be causing me problems.

It's probably something stupid but if someone could take a look and point me in the right direction, I'd be very grateful.


Public Sub dbConnection()
        dbConnString = ConfigurationManager.ConnectionStrings("connString").ConnectionString
        sqlConn = New SqlConnection(dbConnString)
    End Sub

Public Sub EquipmentDDLSelection()

        Dim dbCMD As New SqlCommand("PopulateCalendar", sqlConn)
        dbCMD.CommandType = CommandType.StoredProcedure

        Dim parameterBookedEvents As New SqlParameter("@bookedEvents", SqlDbType.VarChar, 50)

Sharepoint My Sharepoint Sites not updating.


The sharepoint My Sharepoint Sites list will not update.  It last updated with the results from 4/22/10. I determined that by looking in out Share Sevices Administration  database in the memberGroup table.  It shows current entries for everything prefaced by Mailto:   So the distribution groups are updating however, nothing is updating for the actual sites.  New sites have been added since this time and Membership in the Members group of these sites has  changed as well but none of these changes have been reflected i nthe My sharepoint sites.   These changes also do not appear in the My Memberships portion of someone's My Site.  Any suggestions?


We are running Sharepoint 2007 SP2 with W.S.S. 3.0 on a Windows srver 2003 R2 SP2 server.    No changes were made to the system on the date in question.  Perhaps 3 new team sites has been added in the days leading up to the problem. 

We see no errors in any of the timer jobs or the event logs that appear related to the issue.



Personal view reverts back to default after updating properties of item


I am working with a company that has 1 site collection with several sub sites.  I have built 3 document libraries with workflow in 3 different sub sites and all behave as expected.  I have one site where ALL libraries do something perplexing;

If you are in a custom personal view and you go into the properties of a document and then exit (update or not, does not matter) it reverts back to the default view of that library. 

Has anyone seen this?  is there an option when creating an album that could cause this?

thanks in advance for any input on this odd issue.

Updating Task Lists and Form Libraries From Workflow Form


There are actually two separate (I think) problems here. The scenario: I used the SharePoint Designer 2007 to create a workflow attached to a form library. When a form is submitted to the library, a To-Do-Item is created on a task list. The To-Do-Item is initially assigned to a GROUP. A user from the group then selects the name of an individual from a choice list in edit item. This person now becomes the Assigned To for the task.

What is needed is 1) To update the Assigned To column of the Form library when someone in the GROUP assigns the task to an INDIVIDUAL; and 2) To have the Due Date from the submitted InfoPath form propagate to the task list.

I've tried having one workflow try to do everything and also having a secondary workflow set up on the task list to do the task assignment update but have not been successful in solving either issue. I don’t think that I am really understanding how to Define Workflow Lookup when not working with the Current Item. I know what fields I want but I don’

stsadm -0 copyappbincontent not updating all the appropriate Web Applications


On Sharepoint 2007 SP2:  "stsadm -o copyappbincontent" is not updating the web.config  in my (Sharepoint Central Admin) folder C:\Inetpub\wwwroot\wss\VirtualDirectories\xxxxx   .

It only updates the single web.config file in my C:\Inetpub\wwwroot\wss\VirtualDirectories\80     folder.

Without all web.config files and related content being updated, it prevents the use of certain functions within Central Admin-->.

What would prevent that stsadm command from updating all web.config files?

Updating sites based on a template


I'm currently planning a SharePoint site which will hold a number of subsites. All of these subsites will be based on a sitetemplate. Now in the future, I'm forseeing changes being made to that template. That's because at this point, it's not 100% clear how the subsites should look. We're probably going to miss out on some things which we will correct in the future.

Now suppose I've got a 100 sites already created and my manager tells me that I have to add a document library. I can add it, save the site template again and all the newly created sites (sites are created in our CRM app) will have the new document library. But what about all the sites already there? They'll won't get updated so they won't have the new document library. And if I want to add it, I would have to add it manually a 100 times, or write some code which will add it.

Now a new document library is only an example. There could be a lot more going on, like pages changing, webparts being added or deleted, etc. How do you guys facilitate such things? Or is a question of once a site is created it's just bad luck?

MCTS in Web Application Development in .NET 2.0
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