.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

validating csv file with xsd schema

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

Hi, i have to validata a csv file using xsd schemas that is provided with the file to validate.

I was thinking to validate the file with datatable but the problem is that datatable doesn't accept some restrictions like minLegth and facets that i need to control some values.

Is saw xmlSchemaSet but it validates xml files and i don't know if it's possible to validate single records that are provided to the validation module as an array with the elements inside, to say if i have a record with 4 fields the validation module will take as input an array of 4 strings.

View Complete Post

More Related Resource Links

problem with sitemap schema 'xsi:schemaLocation' in XML file creation

SqlConnection conn = new SqlConnection(connStr); conn.Open(); string sql = "select top 10 catnum,cast(case when isnull(onhand,0) < 5 then 0 else round((onhand/2),1) end as int) as onhand from dbo.V_OnHand with (nolock)"; SqlCommand cmd = new SqlCommand(sql, conn); XmlDocument doc = new XmlDocument(); XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null); XmlElement rootNode = doc.CreateElement("inventory"); doc.InsertBefore(dec, doc.DocumentElement); rootNode.SetAttribute("xmlns", "http://seller.marketplace.tests.com/inventory/v1"); rootNode.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); rootNode.SetAttribute("xsi:schemaLocation", "http://sellersupport.domain.test.com/test1/s/schema/inventory/inventory-xml-feed-v1.xsd"); doc.AppendChild(rootNode); XmlElement fbm = doc.CreateElement("inventory"); doc.DocumentElement.PrependChild(fbm); SqlDataReader rdr1 = cmd.ExecuteReader(); while (rdr1.Read()) { XmlElement item = doc.CreateElement("item"); item.Set

how do i create a schema.ini file from a tab delimited file?

Hi there,How do I create a schema.ini file from a tab delimited file?I have this so far:[myFile.txt]ColNameHeader=TrueFormat=TabDelimitedCharacterSet=ANSII think I need something like this after my last line from above:Col1=first TEXT width 150My text file has 7 columns, the first row is the header row. The data comes from a Micosoft SQL Server Database where the fields are of the following types:intnvarchar(MAX)nvarchar(50)Many many thanks,Kiley

schema path while validating XML in WCF service


hi all,

i have a WCF service where I am validating an XML path against an XSD.

I am getting the schema as follows:

XmlSchemaCollection xsc = new XmlSchemaCollection();

xsc.Add(null, "c:/MyDownloads/Doc1.xsd");

But i want to include the Doc1.xsd in my application and specify the path from there.

How to do that?

what comes first, xml file or xsd schema?


im learning about xml, and doing it by writing a few test applications.

Im currently writing an app that will do two things:

Create an xml file containing data surrounding Music Albums.

Read in an existing xml file and validate it against a schema.

Right now i want to do part 1,create an xml doc.  What i dont know though is what comes first. do i create an xml doc from a schema or vice versa? I have a schema created but not sure if it will do me any good in creating an xml doc.


Thanks all.

Flat file schema in C#



From our external service we get response in the form of fixed length / delimited character format. Currently we are parsing this response manually like calculating substring..

Can you help me to understand if there is any feature to create Flat File schema in C# & parsing response aganist this schema format.

I have seen FlatFile feature in BizTalk Server, in C# I am not sure on this.

thank you,

-nm reddy

thank you -nm reddy

file attachment control on infopath 2010 browser form, validating event not fired


If preview within InfoPath 2010, the validating event is fired. But After deploying the form to SharePoint 2010, the validating event does not fire.

Any ideas?


Blog: http://convergingpoint.blogspot.com/

How to Create a Table from XML Schema File (.xsd) in SSIS 2005

I have a .xsd schema file from an Informix table. I want to create the same table in the SQL Server 2005 using SSIS 2005. Is there any work arround that i can do this from a file?
If could do this using any other SQL Server 2005 file Objects.

Immidiate Help would be appriciated.

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

ClientAccessPolicy file in SharePoint 2010

I am upgrading my Silverlight demo code from the old beta to beta 2 and see that there are a few new considerations for the deployment of ClientAccessPolicy.xml files. In a previous post I demonstrated how to do this for SharePoint 2007. The heartburn that I get with that approach is any site collection owner or designer can drag the file into the site collection and open the site up to unwanted client access issues. In 2010 the virtual path provider no longer serves the files from the root of the site collection

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

Transfering a file from Conputer to PDA

You can transfer one file at a time between your computer and another Bluetooth device by using the Bluetooth File Transfer Wizard. For example, you can transfer files between your computer and a mobile phone or a PDA. You can also transfer files between two computers that use Bluetooth.

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:
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