.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

need help in creating XML Schema Collection

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
I have below sample data from a system, Table X Col_Name                DataType  systemName            string  SystemVersion         Decimal  SubmitedOn             DateTime Now, I m creating below XML by above data in C#, <Source_XML>   <SystemName Value="Timesheet" Name=""></SystemName>   <SystemVersion Value="1.0" Name=""></SystemVersion>   <SubmitedOn Value="08/31/2010" Name=""></SubmitedOn> </Source_XML>   Now I need to prepare XML SCHEMA for above XML by C# and register the same in SQL 2005...so that nxt time we can validate above XML. Please someone suggest me how to do above functionality....creating schema at runtime by C# and register the same schema into SQL 2005 database. thanks,

View Complete Post

More Related Resource Links

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

how to create XML Schema Collection for SQL 2005

I am generating below schema at run time in C#, Is there any way to create a XML Schema in SQL 2005 for this run time generated schema??? <?xml version="1.0" encoding="utf-16"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Address"> <xs:complexType> <xs:sequence> <xs:element name="Name" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

Error Creating Site Collection

Hello, I have created a basic claims-based web app in SharePoint 2010. When I try to create a Site Collection, after filling out all the details, I get the following error:   Error  Cannot complete this action. Please try again.  Troubleshoot issues with Microsoft SharePoint Foundation.  Correlation ID: 349b9ae9-7bda-41eb-921a-87974afb289c    I have tried ever which way to try and get it to work, but am still stuck. Any ideas as to why I can't create a Site Collection? Thanks!

Error when creating site collection through programmatically?

hi all, When i am creating SharePoint Site collection through programmatically i am getting an error message. i am using below code...   using (SPSite site = new SPSite("http://servername:7853/")) {   using (SPWeb web = site.OpenWeb()) {   SPWebApplication oweb = web.Site.WebApplication; site.AllowUnsafeUpdates = true;   SPSiteCollection sitecol = oweb.Sites;   SPSite site1 = oweb.Sites.Add("sites/DemoSiteCol", "DemoSiteCol", "Welcome to the Client SiteCol",1033, "STS#0", "Domian\\user", "display name", "user@domian.com");//here i am getting the error message as "Object refernce not set to an instance of an Object". oweb.Update(); } Please tell me why i am getting the error message.... thanks in advance.....

which one is better site template or site collection template for creating site collection?

hi all, i want to create site collection by using custom template. So I created one site and i saved as a template and i want to use this site template to create site collection...can we use site template  or site collection template to create site collections? what is the difference between site template and site collection template? please advise me which one is better..... thanks in advance...

Capture attributes from schema into collection


Is there any way to capture all attributes/values (from the SOAP message) into a colleciton of my type? I tried to look at the DataContractSerializer to understand how I could initiate a new instance of my DataContract and then populate all attributes into a collection, but I can seem to find there to look.

I have a DataContract Account with properties Name (string) and Number (string), which I would like to capture into a non-datamember (collection) upon receipt from the client side. Should I look to the IXMLSerializer and move to XmlSerializerFormat - or is it possible anyhow ? I tried implement the




'Friend Sub OnDeseriali

Creating a pivot of a collection and displaying it in a databound grid with dynamic columns



I'm trying to create a pivot of some data that I have about translation.

Basically what I have now is a collection of "Translation" objects which look like that :

Public Class SystemText
  Inherits Entity

#Region "Private variables"
  Private _textCategory As String
  Private _textName As String
  Private _languageCode As String
  Private _description As String
#End Region

#Region "Properties"
  Public Overridable Property TextCategory() As String

Problems with Schema Collection and Namespaces


Our company is going to start exchanging XML documents and I'm trying to understand how to correctly use XML data types in SQL Server 2005.

There is a published xsd which I think I'm supposed to store in a Schema Collection so that Sql Server can use it to validate typed XML variables and columns.
There also are some examples XML documents available for testing.

Because the xsd and the samples are relatively huge (1-2 megabytes each),  I have distilled both down to the minimum necessary fields both for my own sanity while testing and for use in examples to forums such as this.

I believe I am down to my last problem which centers on understanding namespaces.

The actual XML documents do not and will not have any namespace parameters within them.
But I am only able to succesfully validate my testing samples when I include an xmlns parameter.
What am I doing wrong?
How can I get a sample without an xmlns parameter to successfully validate?

Here is what I have:

USE LSExport

IF EXISTS (SELECT * FROM sys.xml_schema_collections WHERE [name] = 'MyPrivateSchemaCollection')
 DROP XML SCHEMA COLLECTION dbo.MyPrivateSchemaCollection

DECLARE @testSchema XML
SET @testSchema =
'&lt;?xml version="1.0" encoding="UTF-8"?&gt;

Problems Creating a new site collection


Hi all,

I am attemping to create a new site collection in code. This works fine on my test box, but when I moved it to production I keep getting access denied. Here is some of the code I am using:

Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCreate.Click

        'Create the new site collection
        Dim elevatedCode As New SPSecurity.CodeToRunElevated(AddressOf CreateSite)

  End Sub ' End btnCreate_Click
''' <summary>
  ''' Create the new site collection
  ''' </summar

Creating Site Collection in Existing Content Database

Hi All,

I'm trying to create a site collection in a existing content database. I haven't found a method in Sharepoint object model to perform such a action. There is an option to create a site collection in a new database using the following command:
SPSiteCollection.Add(url, siteDescription, siteDescription, 1033, siteTemplate,
                                                                siteCollPrimaryAdmin.LoginName, siteCollPrimaryAdmin.Name, siteCollPrimaryAdmin.Email,
                                                                siteCollSecondaryAdmin.LoginName, siteCollSecondaryAdmin.Name, siteCollSecondaryAdmin.Email,
                                                                strSQLServerName, siteContentDBName, null, null);

Is there a different object to do this creation on existing database? Any ideas to approach this problem will be greatly appreciated



Creating My Site collection on new web app causes web part errors


I'm configuring a brand new SharePoint 2010 Enterprise instance for the first time.  We have 2 WFE, 1 app server and 1 DB server.  Having read it is best practice, I created a new web application for My Sites.  I chose to use the same IIS site and IP address as the main SharePoint site collection but a different host header (my.sharepoint).  The problem I've come against is that opening http://my.sharepoint from any location except the application server throws a bunch of web part errors.  (Web Part Error: This page has encountered a critical error. Contact your system administrator if this problem persists.)  However, when I open the site from the application server box, I don't get the errors.  I think the problem has to do with the WFEs.  I'm seeing a bunch of DCOM errors on the WFEs complaining about security but I don't know if that is related or how to change the security of the DCOM components, the buttons are greyed out.

Can anybody help me start trouble shooting this? 

Creating your SharePoint Governance Plan

One of the most common questions that I get from prospects as I'm talking to them about the creation of a governance plan and process is what does it look like. In other words, there are materials available which describe what should be in a governance plan but there isn't a ton of guidance on what the process of creating a governance plan and process are.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Creating an AJAX Repeater in ASP.NET MVC

The "TaskList" is a tried an true example of the most basic thing that you can do in any framework. Unfortunately, I had some problems finding a really good example of all the steps necessary to get a task list to work in ASP.NET MVC 1.0.

Creating a Generic Entity Framework 4.0 Repository

With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Creating SharePoint items with CreateItemActivity

Instead of creating new list items from code in your workflow you can use CreateItemActivity. CreateItemActivity can be used for creating list items or files. Properties of interest for this activity are the following (most of them are self-explanatory):
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