#region "GetDataSetBySchema"
        /// <summary>
        /// GetDataSetBySchema - Returns the Dataset for required schema
        /// </summary>
        /// <param name="strFormCode"></param>
        /// <returns>Dataset</returns>
        public DataSet GetDataSetBySchema(string strXmlSchemaPath)
        {
            DataSet dsXml = new DataSet();
            string strSchemaPath = string.Empty;
            try
            {
                dsXml.ReadXmlSchema(strXmlSchemaPath);
                return dsXml;
            }
            catch
            {
                throw;
            }
        }
        #endregion

        #region "ConvertXMLToDataSet"
        /// <summary>
        /// ConvertXMLToDataSet - Convert the Xml into the Dataset
        /// </summary>
        /// <param name="strXml"></param>
        /// <returns>Dataset</returns>
        public DataSet ConvertXMLToDataSet(string xmlData)
        {
            StringReader stream = null;
            XmlTextReader reader = null;
            try
            {
                DataSet xmlDS = new DataSet();
                stream = new StringReader(xmlData);
                // Load the XmlTextReader from the stream   
                reader = new XmlTextReader(stream);
                xmlDS.ReadXml(reader);
                return xmlDS;
            }
            catch
            {
                return null;
            }
            finally
            {
                if (reader != null)
                    reader.Close();
            }
        }
        #endregion

 

Reference:

http://www.codeproject.com/Purgatory/DataSetToXml.asp
http://msdn2.microsoft.com/en-us/library/9d83k261.aspx

 

 

//1. Stream to StringMemoryStream memStream = new MemoryStream();
byte[] data = Encoding.Unicode.GetBytes("Hello World! This is Streaming.");

//write the array into stream
memStream.Write(data, 0, data.Length);
Response.Write(
"1.<br/>" + Encoding.Unicode.GetString(data));
//2. String to Stream
byte[] data2 = memStream.GetBuffer();
//alternatively byte[] data2 = new byte[memStream.Length];//Following 2 lines are optional whether u want to read
//memStream.Seek(0, SeekOrigin.Begin);
//memStream.Read(data2, 0, (int)memStream.Length);Response.Write("<br/>2." + Encoding.Unicode.GetString(data2).ToLower());
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

# Links (6/21/2007)

.NET ARCast.TV - Presenter First Pattern (Part 3) SubSonic: New Query Engine In The Works How to sort 6/22/2007 7:43 AM | Member Blogs

Post a comment





 

 

News

Employers
Soppa Group India
iSmart Panache Inc
R Systems Internationals Ltd
Technovate eSolutions Pvt Ltd
The contents of this blog are my personal opinion and do not represent in any way the view of my employer.
These postings are provided "AS IS" with no warranties, and confer no rights.

Google PR™ - Post your Page Rank with MyGooglePageRank.com

Archives

Post Categories

Image Galleries

Articles & Magazines

ASP.Net 2.0 Compilation

ASP.Net, Blogs I refer...

Atlas

Dost

Drivers and Software Download

Garhwal

Travel Domain

WSS and WebParts

Syndication: