xml 파일에서 채워진 DataSet이 있는데 주 DataTable을 여러 DataTable로 나누고 싶습니다. asp.net 분할 xml DataTable
은의이 테이블의 형식입니다 가정 해 봅시다 :Column1 | Column2
1234 | 4567
1234 | 1122
1234 | 2233
1000 | 3344
1000 | 5566
내가 2 개 테이블, 1000 개 값에 대한 모든 1,234 값을 포함 하나 하나에 위를 분할해야합니다.
WebClient wc = new WebClient();
wc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
string strXmlString = wc.DownloadString(strUrl); // Download the URL to a string
strXmlString = Regex.Replace(strXmlString, @"m:null.+?>{1}", @"/>"); // Find ' m:null[anything]>' and replace it with '/>'
strXmlString = Regex.Replace(strXmlString, @"[\s]{1}m:.+?>{1}", @">"); // Find ' m:type[anything]>' and replace it with '>'
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(strXmlString); // Load the XML String into an XML Doc
XmlReader xReader = new XmlNodeReader(xDoc);
DataSet ds = new DataSet();
ds.ReadXml(xReader); // Upload the XML Doc Data to the DataSet
가 어떻게이 개 테이블로 ds.Tables[0]
을 나눌 것입니다 :
이 내가 XML 파일 제대로 그 일을 읽고 어떻게?
두 솔루션 작동합니다. 고맙습니다. –