XML & Datasets

How To: Get the DISTINCT rows in a DataTable or DataView

How To: Get the DISTINCT rows in a DataTable or DataView http://devpinoy.org/blogs/k

Generic xmlTextReader

Generic xmlTextReader Original article: http://www.dotnetspider.com... ////-----------------------... ////convert XML string to MemoryStream ////-----------------------... MemoryStream memoryStream = new MemoryStream(); byte[] data = Encoding.Unicode.GetBytes(s... memoryStream.Write(data, 0, data.Length); memoryStream.Position = 0; ////-----------------------...

indent xml with .NET

Original Article: http://bytes.com/forum/thre... Is there a simple way to indent xml with dotnet? SQL Server returns a long xml string that is hard > to read.[/color] XmlReader r = new XmlTextReader(new StringReader(myXML)); StringWriter sw = new StringWriter(); XmlTextWriter w = new XmlTextWriter(sw); w.Formatting = Formatting.Indented; while (r.Read()) w.WriteNode(r, false); w.Close(); r.Close(); Console.WriteLine(sw.ToStri... -- Oleg Tkachenko [XML MVP] http://blog.tkachenko.com...

C# Different XML Extraction Techniques

C# Different XML Extraction Techniques http://developer.yahoo.com/

Strongly Typed TableAdapters ASP.NET 2.0

Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0 Scott Mitchell's Masterpiece: http://www.asp.net/learn/da... http://weblogs.asp.net/scot... http://msdn2.microsoft.com/... http://aspalliance.com/914_...

How To Read XML Data into a DataSet by Using Visual C# .NET

How To Read XML Data into a DataSet by Using Visual C# .NET Original MSDN article: http://support.microsoft.co... public class XMLtoDataset { public static DataSet GetDatasetFromXMLString(string inString) { StringReader StringReader; XmlReader XmlReader = null; try { Console.WriteLine("Initiali... StringReader ..."); if (inString.IndexOf("<?xml version='1.0'?>") == -1) { inString = "<?xml version='1.0'?>" + inString; } //StringReader = new StringReader("<?xml version='1.0'?>"...

Get and Validate XML from WebSite and convert to Dataset

public bool GetDataFromWebSite() { bool myReturnBool = true; try { System.Net.WebRequest webRequest = System.Net.WebRequest.Creat... //-------------------------... // how to get your proxy from Internet Explorer // open Internet Explorer // Menu: Tools -> Internet Options // Connections Tab -> Lan Settings Button // copy and paste from "Address" text box e.g. < proxyServer.com > //-------------------------...

ObjectDataSource could not find a non-generic method 'Update' that has parameters: ...., original_Id.

Problem: ObjectDataSource could not find a non-generic method 'Update' that has parameters: ...., original_Id. Take steps: 1) Change ObjectDataSource : OldValuesParameterFormatStr... to OldValuesParameterFormatStr... 2) Remove original_Id references from : (a) update stored proc (if automatically generated), (b) dataset (XSD) other links: http://geekswithblogs.net/c...

ASP.NET 2.0 Fetching & Persisting Strongly Typed Datasets

Original Article by Scott Mitchell, http://www.asp.net/learn/da

DataTable.DataTableReader example

public string _LogString_ViaDataReader { get { string x = ""; try { DataTableReader reader = _dsMarkit_log.MARKIT_LOG.Cr... StringBuilder sb = new StringBuilder(); while (reader.Read()) { // Given a DataTableReader, display column names. for (int i = 0; i < reader.FieldCount; i++) { sb.Append("\r\n" + reader.GetName(i) + ": "); if (reader.IsDBNull(i)) { sb.Append("<NULL>"); } else { try { sb.Append(reader.GetValue(i... } catch (InvalidCastException) { sb.Append("<Invalid...

wrap dataset storage in view state, in a property

public DataSet MyDataset{ get { //-------------------------... // get dataset from viewstate //-------------------------... DataSet localDataset = null; object o = ViewState["viewStateDataset"]; if (o == null) { //-------------------------... // ViewState is null, dataset get from Db //-------------------------...

Dataset to XML then transform with XSLT to HTML on WebForm

Private Sub GetXSLT() Try Dim parms As Specialized.HybridDictionary = New Specialized.HybridDictionary Dim df As New DataFactory Dim dataset As DataSet = df.GetDataSet("storedProc_G... parms) '--------------------------... 'Get the primary key column from the master table '--------------------------... Dim primarykey As DataColumn = dataset.Tables("Table").Col... '--------------------------...

XSLT to HTML Primer

XSLT to HTML Primer Rescuing XSLT from Niche Status - original article by David Jacobs http://www.xfront.com/rescu... This tutorial will focus on the generation of HTML documents. XSLT is a programming language for translating an Input XML Document into another format, say an HTML Output Document. For each element, you need to determine how the element needs to be translated. If there are one-to-one mappings or one to zero mappings, this is straightforward. For example, if every occurrence...

ADO.NET and XML

An Introduction to the XML Tools in Visual Studio 2005 http://msdn2.microsoft.com/... original article by Xinjie ZHANG http://www.codeproject.com/

webRequest, webRequest.Proxy, webResponse , XSD to validate webResponse , XSD to create and populate strongly-typed dataset

How To: Create webRequest set webRequest.Proxy fetch data from vendor via webResponse = webRequest.GetResponse(); use XSD to validate webResponse use XSD to create strongly-typed dataset strongly-typed dataset.ReadXML to populate strongly-typed dataset from webResponse Hopefully a vendor can send you some xml that looks like this: http://www.SomeVendor.com" xmlns:xsi="http://www.w3.or... xsi:schemaLocation="http://... LX010053 2006-09-26 LX010063...

convert xml string to dataset & WriteXmlSchema to string

//convert xml string to dataset, and WriteXmlSchema to string System.IO. DataSet dsResponse = new DataSet();StringReader sr = new System.IO.StringReader(resp... sr = new System.IO.StreamReader( dsResponse.ReadXml(sr); System.Text. StringBuilder builder = new System.Text.StringBuilder();// Create the StringWriter object with the StringBuilder object. System.IO. StringWriter writer = new System.IO.StringWriter(buil... Write the schema into the StringWriter. dsResponse.WriteXmlSchema(w...

Strong dataset returns empty tables plus unexpected populated tables.

Strong dataset returns empty tables plus unexpected populated tables. In example below, map unexpected table "Table" to expected table "dtUsage") In example below, map unexpected table Dim da As New SqlDataAdapter(cmdTest)Dim dsUserUsage As New dsUserUsageda.TableMappings... "dtUsage") da.TableMappings.Add("Table1", "dtDates") da.Fill(dsUserUsage) "Table1" to expected table "dtDates")...

Strong dataset returns empty tables plus unexpected populated tables.

Strong dataset returns empty tables plus unexpected populated tables. In example below, map unexpected table "Table" to expected table "dtUsage") In example below, map unexpected table Dim da As New SqlDataAdapter(cmdTest)Dim dsUserUsage As New dsUserUsageda.TableMappings... "dtUsage") da.TableMappings.Add("Table1", "dtDates") da.Fill(dsUserUsage) "Table1" to expected table "dtDates")...