Pages

Saturday, February 20, 2010

Query XML String as a SQL Table.

This basic sample demonstrates how to read string xml data as a normal sql table.
This is very useful is you want to parse bulk data into sql server stored procedure.
For this example I am using ArrayList of my “Test” class. And using XmlSerializer I am going to convert it in to XML. For demonstration purpose I am just declare a SQL variable “@XMLString” to hold xml data.
declare @XMLString xml

set @XMLString = '?<ArrayOfTest>
<Test>
<TestID>1</TestID >
<TestName>ASP.NET Test</TestName>
<TestDuration>2 Hrs</TestDuration>
</Test>
<Test>
<TestID>2</TestID>
<TestName>SharePoint Test</TestName>
<TestDuration>2 Hrs</TestDuration>
</Test>
<Test>
<TestID>3</TestID>
<TestName>SQL Server Test</TestName>
<TestDuration>2 Hrs</TestDuration>
</Test>
</ArrayOfTest>'

Now we can perform query against @XMLString using nodes function and xpath.


select TableAlias.ColumnAlias.value('TestID[1]','VARCHAR(20)') ,
TableAlias.ColumnAlias.value('TestName[1]','VARCHAR(20)') ,
TableAlias.ColumnAlias.value('TestDuration[1]','VARCHAR(20)')

from @XMLString.nodes('//ArrayOfTest/Test')TableAlias(ColumnAlias)


Example 2:
Here is an example of little advanced filtering with XPath.

select TableAlias.ColumnAlias.value('TestID[1]','VARCHAR(20)') ,
TableAlias.ColumnAlias.value('TestName[1]','VARCHAR(20)') ,
TableAlias.ColumnAlias.value('TestDuration[1]','VARCHAR(20)')
from @XMLString.nodes('//ArrayOfTest/Test[TestID >= 2]')TableAlias(ColumnAlias)

Download Source
Click here to Read MSDN for more info

Sunday, January 10, 2010

Discussion board anonymous reply with custom view

We can achieve this requirement by adding new list view template to Discussion List, i will call it "Flat Anonymous".

Steps,

1. Open FEATURES\DiscussionsList\schema.xml

(Exact Path : Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\DiscussionsList\schema.xml)

(don't forget to Backup schema.xml file before doing any modifications)

2. Find PersonViewMinimal

3. Create a copy and name it PersonViewMinimalExtended

4. it should look like following

<Field ID="{b4ab471e-0262-462a-8b3f-c1dfc9e2d5fd}" Name="PersonViewMinimalExtended" DisplaceOnUpgrade="TRUE" Group="_Hidden" Filterable="TRUE" Sortable="TRUE" Type="Computed" DisplayName="$Resources:core,Posted_By;" ReadOnly="TRUE" AuthoringInfo="$Resources:core,picture_and_name;" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonViewMinimalExtended">

<FieldRefs>
<FieldRef ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" Name="Editor" />
<FieldRef ID="{adfe65ee-74bb-4771-bec5-d691d9a6a14e}" Name="PersonImage" />
<FieldRef ID="{bd2216c1-a2f3-48c0-b21c-dc297d0cc658}" Name="IsRootPost" />
</FieldRefs>

<DisplayPattern>
<Switch>
<Expr>
<Field Name="IsRootPost" />
</Expr>
<Case Value="TRUE">
<HTML><![CDATA[<table cellpadding="0" cellspacing="0"><tr><td style="padding-left: 5px;">]]></HTML>
<Field Name="PersonImage" /><HTML><![CDATA[</td></tr><tr><td style="padding-left: 5px;" nowrap>]]></HTML>
<Field Name="Editor" /><HTML><![CDATA[</td></tr></table>]]>
</HTML>
</Case>
<Default>
<HTML><![CDATA[&nbsp]]></HTML>
</Default>
</Switch>
</DisplayPattern>

</Field>





5. find $Resources:core,DiscussionViewFlat;

and create a copy from that view () .

and Change BaseViewID = "20" of newly created view

and Change display name to DisplayName="Flat Anonymous"

6. Find

from newly copied view

7. Rename it to
Now go to SharePoint site discussion board list and create new view.

Then select "Flat Anonymous" as the template.

Wednesday, November 11, 2009

Forms Authentication in SharePoint

http://msdn.microsoft.com/en-us/library/bb975136.aspx

Monday, October 26, 2009

Re-using SharePoint controls

http://community.zevenseas.com/Blogs/Robin/archive/2009/07/03/re-using-sharepoint-controls.aspx

Monday, August 24, 2009

Deep Dive into the SharePoint Content Deployment and Migration API

http://blogs.technet.com/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-1.aspx

Monday, August 17, 2009

SharePoint Planning Visio Diagrams

TECHNET - Technical diagrams and other supplemental documentation

http://technet.microsoft.com/en-us/library/cc263199.aspx

Models
Model: Business Intelligence
Model: Office SharePoint Server Application Security
Model: Office SharePoint Server Backup and Restore
Model: Office SharePoint Server Topologies
Model: Office SharePoint Server Baseline Site Hierarchies
Model: Office SharePoint Server Customization
Model: Office SharePoint Server Database Administration
Model: Office SharePoint Server Enterprise Content Management
Model: Office SharePoint Server Extranet Topologies
Model: Office SharePoint Server Inter-Farm Shared Services
Model: Office SharePoint Server Products Migration
Model: Office SharePoint Server Search Administration
Model: Office SharePoint Server Shared Services
Model: Upgrading Office SharePoint Server Products
Model: Upgrading SharePoint Portal Server 2003 to Office SharePoint Server (1 of 2)
Model: Upgrading SharePoint Portal Server Version 2 to Office SharePoint Server (2 of 2)

Scenarios
Scenario: Enterprise Content Management
Scenario: InfoPath Forms Services Customer Interaction Form
Scenario: InfoPath Forms Services Expense Reporting
Scenario: InfoPath Forms Services Insurance Claims
Scenario: InfoPath Forms Services Permits
Scenario: InfoPath Forms Services Supplier Survey
Scenario: Keeping Connections to Data Sources Current
Scenario: Large Corporate Internet Site (Infrequent Changes to Web Content)
Scenario: Office SharePoint Server Call Center
Scenario: Office SharePoint Server Corporate Intranet Portal Site
Scenario: Office SharePoint Server Departmental Portal Site
Scenario: Office SharePoint Server Equities Research
Scenario: Office SharePoint Server Informational Portal Site
Scenario: Office SharePoint Server Out-Hosted Portal Sites (ASPs)
Scenario: Online News Internet Site (Frequent Web Content Updates and Searching)
Scenario: Preserving “One Version of the Truth” for Distributed Workbooks
Scenario: Records Management in Office SharePoint Server
Scenario: Rendering Data from Spreadsheets to Web Parts

Flowcharts
Office SharePoint Server Planning Flowchart, Part I (application administrators)
Office SharePoint Server Planning Flowchart, Part II (IT pros)
Office SharePoint Server Deployment Flowchart

For more on Visio and SharePoint, see:
Integrating Visio 2007 with Microsoft Technologies
Visio Services and SharePoint 2010