<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Luigi Melisi &#187; row</title>
	<atom:link href="http://www.luigimelisi.com/tag/row/feed" rel="self" type="application/rss+xml" />
	<link>http://www.luigimelisi.com</link>
	<description>Development Blog : C# Code Samples,.NET Tips and Tricks</description>
	<lastBuildDate>Thu, 03 Mar 2011 09:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>[VB.NET] : Popolare una DataTable con un file CVS</title>
		<link>http://www.luigimelisi.com/tips-and-tricks/vb-net-popolare-una-datatable-con-un-file-cvs.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vb-net-popolare-una-datatable-con-un-file-cvs</link>
		<comments>http://www.luigimelisi.com/tips-and-tricks/vb-net-popolare-una-datatable-con-un-file-cvs.html#comments</comments>
		<pubDate>Sat, 20 Mar 2010 00:54:39 +0000</pubDate>
		<dc:creator>Luigi Melisi</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[ControlChars]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[dim]]></category>
		<category><![CDATA[finalLine]]></category>
		<category><![CDATA[fullFileStr]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[row]]></category>
		<category><![CDATA[Split]]></category>
		<category><![CDATA[streamreader]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.luigimelisi.com/?p=711</guid>
		<description><![CDATA[Di seguito un semplice esempio che mostra come popolare un DataTable utilizzando Vb.Net.]]></description>
			<content:encoded><![CDATA[<p>Di seguito un semplice esempio che mostra come popolare un <strong>DataTable</strong> utilizzando Vb.Net :
<pre class="brush: vb; title: ; notranslate">
Function ReadCSV(ByVal path As String) As System.Data.DataTable
Dim sr As New StreamReader(path)
Dim fullFileStr As String = sr.ReadToEnd()
sr.Close()
sr.Dispose()
Dim lines As String() = fullFileStr.Split(ControlChars.Lf)
Dim recs As New DataTable()
Dim sArr As String() = lines(0).Split(&quot;,&quot;c)
For Each s As String In sArr
recs.Columns.Add(New DataColumn())
Next
Dim row As DataRow
Dim finalLine As String = &quot;&quot;
For Each line As String In lines
row = recs.NewRow()
finalLine = line.Replace(Convert.ToString(ControlChars.Cr), &quot;&quot;)
row.ItemArray = finalLine.Split(&quot;,&quot;c)
recs.Rows.Add(row)
Next
Return recs
End Function&lt;/pre&gt;
</pre>
<p><a href="http://www.youbuy.it/lastminute.aspx" rel="nofollow" target="_blank"><img class="aligncenter" title="YouBuy.it - Last Minute - Offerte Sottocosto" src="http://images.youbuy.it/adv/last.jpg" alt="last [VB.NET] : Popolare una DataTable con un file CVS" width="450" height="600" /></a><br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luigimelisi.com/tips-and-tricks/vb-net-popolare-una-datatable-con-un-file-cvs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

