Read/Write Large XML Files


Up to certain extent the performance quite depends on .NET version your application is running on.

Another quick reference is Microsoft Patterns and Practices article

There’re 4 ways to read and write XML

Continue reading Read/Write Large XML Files

Parsing XML with special characters


LINQ to XML and XPath


An XML needs to be parsed – I was told the other day. My first questions from experience, how big the XML is going to be? Do we know the schema? The answer : It’s never going to be bigger than few lines, as we use it to store our application’s menu – which may or may not have child(ren). And yes we know the XML schema. Enough said. Continue reading LINQ to XML and XPath

XML / XSD Validation


I know, I should probably have a separate page for XML and C#, but friends trust me there are plenty out there and I’d very much not like to simply copy and paste it all, rather to share URLs. The resources that helped me most were [drum-roll] MSDN & W3Schools.com (http://xmlmaster.org is also a strong competitor though – IMO )

References :

Alright, so w/o further due, assuming you’ve some understanding of XSD, ( of-course ) XML, let’s see how can we Continue reading XML / XSD Validation

C#


Below are some code snippets / recipes that I have had prepared for myself and I thought of sharing with ya’ll as a firs post in C# category. If you do not find one that you are looking for or want more, just drop me a request or comment below, I’d try to address the request.

Example Description Download
Global Variables in C# Different scenarios as your requirement and need zip
Text to SQL Server Read a text file and insert all records in SQL Server. zip
Update combobox items according to selection of column-name in other combobox zip
MySQL(SQL Server) To MsAccess Copy table of Ms-Access from the data of the MySQL zip
(Basic) Reading Ms-Excel spreadsheets Reading data from Excel sheets using C# zip
Updating Ms-Excel spreadsheets Updating data of Excel sheets using C# zip
Accessing .config file The app.config can be used to access some setings (like conn string) anywhere in the project zip
MySQL (SQL Server) database to CSV Convert record set from MySQL query to csv file zip
String Delimiter Various illustrations in a single project, demonstrating ways to use the String.Split() function zip
Date – Times Gets the beginning and ending dates of

  • This Week
  • Last Week
  • This Month
  • Last Month
  • Last 6 Months
  • This Year
  • Last 3 Years
zip
Update/Delete CSV Here is the work around for Updating / Deleting records from CSV, which usually is just a file IO operation otherwise zip
json json in C# using JSON .NET & LINQ zip
json serialization serialization/de-serialization of json zip
Stateful iterations By using yield keyword, difference b/w IEnumerable and IEnumerator zip