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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

XML Reading and Writing

Posted By: Syed Shakeer Hussain     Posted Date: July 31, 2010    Points: 2   Category :C#
 
We learned to process XML files using the Document Object Model as implemented by the XmlDocument class. To go further and make XML friendlier, the .NET Framework provides many other classes for different purposes, allowing you to create and manage nodes from custom .NET classes.
Besides the XmlDocument and the derived classes of XmlNode, the .NET Framework provides the XmlTextWriter class, which is derived from XmlWriter. The XmlTextWriter class works in a top-down approach to create, or deal with, the contents of an XML file. This class writes an XML node and moves down without referring


View Complete Post


More Related Resource Links

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

  
Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Reading/writing Word documents - keeping formatting

  

I've done some reading about reading from and writing to a Word doc. The reading from worked without issue:

string strPath = "Test.doc";
FileStream fStream = new FileStream
    (strPath, FileMode.Open, FileAccess.Read);
StreamReader sReader = new StreamReader(fStream);
string text = sReader.ReadToEnd();
sReader.Close();


But of course this is just a string, without any formatting information included. Writing to the document using a StreamWriter worked, but I received errors when opening the document.

I've also read that trying to perform actions on an Office document on a server without the Office products installed on it can result in mayhem. I'm working on a MVC application that will allow users to upload documents to the server, work on them, save their work and email it around. That doesn't specifically require the need to read/write programmatically, but for certain application functions I do need this. Any helpful suggestions are appreciated.


Reading AND Writing Access 2 databases with SSIS

  

I went for a job interview this morning, and one of the scenarios that the IT manager (a former programmer) told me about was the following .... If anyone could give me any pointers that I can email him pointers to tomorrow (Wednesday 22nd) it may just help tip his decision in my direction. So there's beer in it if you answer a relevent answer, and I get the job.

Old systems using Access 2 databases. These systems are not due to be updated any time soon.

New systems need access to that data, so each night he exports information using SSIS. However, he needs to also write data back, and more often than just overnight.

However, when he connects to the database, using ODBC connections I think, he says that the app (SSIS) opens the tables / database exclusively, even if he selects the option NOT to open it exclusively.

Any ideas, suggestions or comments ?


Reading AND Writing Access 2 databases with SSIS

  

I went for a job interview this morning, and one of the scenarios that the IT manager (a former programmer) told me about was the following .... If anyone could give me any pointers that I can email him pointers to tomorrow (Wednesday 22nd) it may just help tip his decision in my direction. So there's beer in it if you answer a relevent answer, and I get the job.

Old systems using Access 2 databases. These systems are not due to be updated any time soon.

New systems need access to that data, so each night he exports information using SSIS. However, he needs to also write data back, and more often than just overnight.

However, when he connects to the database, using ODBC connections I think, he says that the app (SSIS) opens the tables / database exclusively, even if he selects the option NOT to open it exclusively.

Any ideas, suggestions or comments ?


Reading and Writing Excel Spreadsheets Using ADO.NET C#

  
1)http://support.microsoft.com/search/default.aspx?mode=r&query=how+to+transfer+dataset+to+an+excel+workbook+by+using+asp.net&spid=global&catalog=LCID%3D1033&1033comm=1&ast=25&ast=28&res=20

2)Exporting datagrid to Excel
http://www.codersource.net/asp-net/asp-net-miscellaneous/exporting-data-grid-to-excel-using-c.aspx

Reading And Writing Isolated Storage In Silverlight

  
In this post I will show you how you can create file on the Isolated Storage and also write on that file and also how can you check the size of the Isolated storage.Isolated storage is a mechanism that allows you to preserve data across browser sessions on a user's machine. This storage area is tied to an individual user and helps you overcome the 4 KB limitation of a cookie. Unlike a cookie, isolated storage lies outside of the browser cache.

Reading and Writing Files in SQL Server using T-SQL

  
SQL Server has never been short of ways to read from and write to files and it is always better to use the standard techniques provided by SQL Server where possible. However, most of them are really designed for reading and writing tabular data and aren't always trouble-free when used with large strings or relatively unstructured data.

For reading tabular data from a file, whether character-delimited or binary, there is nothing that replaces the hoary old Bulk Copy Program (BCP), which underlies more esoteric methods such as Bulk Insert. It is possible to read text-based delimited files with ODBC, simple files can be read and written-to using xp_cmdshell, and you will find that OSQL is wonderful for writing results to file, but occasionally I've found I need to do more than this.

Thankfully, when armed with OLE Automation and the FileSystem Object (FSO), all sorts of things are possible. The FileSystem Object was introduced into Windows to provide a single common file-system COM interface for scripting languages. It provides a number of handy services that can be accessed from TSQL. In this article, I provide examples of stored procedures that use this interface to allow you to:

Reading and Writing Data to/from Excel File

  

I need to read and write data from excel sheet. Firstly for example I need to use the concept of accessing workgroup, sheet and then cells whatever I want.

For example I need to use cell A1+B1 and put the result in C1

alternatively I can use the same function above and put data in some other sheet of same excel file.

Please reply the answer either using C#.NET or asp.net using C#.NET


Writing custom MembershipProvider

  
ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

10 Tips for Writing High-Performance Web Applications

  
Writing a Web application with ASP.NET is unbelievably easy. So easy, many developers don't take the time to structure their applications for great performance. In this article, I'm going to present 10 tips for writing high-performance Web apps. I'm not limiting my comments to ASP.NET applications because they are just one subset of Web applications. This article won't be the definitive guide for performance-tuning Web applications-an entire book could easily be devoted to that. Instead, think of this as a good place to start.

Writing Custom Web Parts for SharePoint 2007

  
As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Writing Http Handlers and Modules in IIS 7.5

  
This article describes how Http modules and handlers are to be written and configured in IIS 7.5. The concept of a handler and module remains same, so dose there programming model. In this section we start off with the concept of a Http module and a Http handler, then talk about how to code them and finally describe the two methods available to configure them.

file upload in chunks or not buffering in memory before writing to disk?

  

What are the options for handling file uploads to reduce the memory footprint?  Is there a way to upload in chunks?  Is there a way to stream upload directly to disk instead of loading entire file in server memory?


Thanks


Writing codes using three tier architecture.

  

Hello all.

I am a beginner in c#.I heard that writing program with three tier architecture are easy and maintainable.

I just wanted to know with a small example on how to write three tier architecture programs.


Thanks :-)


reading values from config files in NUnit tests

  

One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?


Reading data from .doc or .docx and inserting into db

  

Hello,

A vendor is providing content which needs to be inserted into the db. The content is basically questions with options and explanations. An example is below.

=========================================

Maximum memory for string ? . System.MemoryOutOfException Occurs when reading the Content of the fil

  

Hi,

I have a C++ code which reads a file [vtk file - its similar to text file only]. and try to store it in string.

here's the code:

String^ ParallelProjectionRenderer::GetVolumeDataAsString(String^ FileName)

{
    vtkSmartPointer<vtkDataSetWriter> sWriter = vtkSmartPointer<vtkDataSetWriter>::New();

    String^ FileName = "D:\\Users\\...";

    char * sptName = static_cast<char *>(Marshal::StringToHGlobalAnsi(FileName).ToPointer());

    sWriter->SetFileName(sptName);

    sWriter->Register(nullptr);

    sWriter->SetInput(this->dataSource);

    sWriter->SetFileTypeToASCII();

    sWriter->Write();

    sWriter->Delete();

    String^ result= File::ReadAllText(FileName);   [it breaks here with system.memoryoutofexception when the file size is huge]

    return result;

}

this code executes fine when the file size is less than 8mb.

I wanted to know whats the maximum memory allocated to the string.


As a workaround i skipped reading out in C++ code. and i tried to read the file contents in asp.net C# code and stor

Categories: 
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