<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: .NET &#8211; Fastest Way to Load Text File To SQL &#8211; SqlBulkCopy</title>
	<atom:link href="http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/</link>
	<description>Homepage of Steve Novoselac</description>
	<lastBuildDate>Tue, 16 Mar 2010 18:51:06 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pr</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-160578</link>
		<dc:creator>Pr</dc:creator>
		<pubDate>Thu, 28 Jan 2010 09:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-160578</guid>
		<description>I have a SQL table with first column &#039;CODE&#039; as autoincrement.&lt;br&gt;I am inserting fresh rows in this table from a datagridview (bound to a datatable) using sqlbulkcopy.&lt;br&gt;&lt;br&gt;Now how can I get back the &#039;CODE&#039; values of the inserted rows to be displayed into the datagridview.&lt;br&gt;&lt;br&gt;Shall be pleased to receive Help and advice.</description>
		<content:encoded><![CDATA[<p>I have a SQL table with first column &#39;CODE&#39; as autoincrement.<br />I am inserting fresh rows in this table from a datagridview (bound to a datatable) using sqlbulkcopy.</p>
<p>Now how can I get back the &#39;CODE&#39; values of the inserted rows to be displayed into the datagridview.</p>
<p>Shall be pleased to receive Help and advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: db</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-160516</link>
		<dc:creator>db</dc:creator>
		<pubDate>Mon, 09 Nov 2009 15:40:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-160516</guid>
		<description>very helpful.</description>
		<content:encoded><![CDATA[<p>very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leszek</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-160512</link>
		<dc:creator>Leszek</dc:creator>
		<pubDate>Fri, 30 Oct 2009 09:59:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-160512</guid>
		<description>Man, this is really awesome. I&#039;ve been looking for a way to insert 900 million rows very quickly and this is the way to do it.&lt;br&gt;Thanks,</description>
		<content:encoded><![CDATA[<p>Man, this is really awesome. I&#39;ve been looking for a way to insert 900 million rows very quickly and this is the way to do it.<br />Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scribbly</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-156666</link>
		<dc:creator>Scribbly</dc:creator>
		<pubDate>Wed, 27 May 2009 01:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-156666</guid>
		<description>I am having problems with the database &quot;corrupting&quot; after Method 3 (have not tried the others yet).

After running Method3 all the rows are inserted OK: I can run a Count(*) query OK to return the number of rows, but when a try to connect again (rerunning the application) I get an error saying the MDR file is the wrong size of the LDR file is locked.

Any ideas?</description>
		<content:encoded><![CDATA[<p>I am having problems with the database &#8220;corrupting&#8221; after Method 3 (have not tried the others yet).</p>
<p>After running Method3 all the rows are inserted OK: I can run a Count(*) query OK to return the number of rows, but when a try to connect again (rerunning the application) I get an error saying the MDR file is the wrong size of the LDR file is locked.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maureen</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-156305</link>
		<dc:creator>Maureen</dc:creator>
		<pubDate>Wed, 20 May 2009 22:04:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-156305</guid>
		<description>For me, I was reading data from an input file and the column with dates in it was in a different date format then the regional settings on my computer.  I changed regional settings - short date setting - on my computer to match the date format in the import file.</description>
		<content:encoded><![CDATA[<p>For me, I was reading data from an input file and the column with dates in it was in a different date format then the regional settings on my computer.  I changed regional settings &#8211; short date setting &#8211; on my computer to match the date format in the import file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sander</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-156016</link>
		<dc:creator>Sander</dc:creator>
		<pubDate>Sat, 16 May 2009 15:05:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-156016</guid>
		<description>Had the same problem - The given value of type String from the data source cannot be
converted to type decimal of the specified target column.

For me, this was due to whole columns having value NULL.

What I did was to add the column mapping before starting using: 
For Each col As DataColumn In SourceDataTable
 bulkData.ColumnMappings.Add(col.ColumnName, col.ColumnName)
Next</description>
		<content:encoded><![CDATA[<p>Had the same problem &#8211; The given value of type String from the data source cannot be<br />
converted to type decimal of the specified target column.</p>
<p>For me, this was due to whole columns having value NULL.</p>
<p>What I did was to add the column mapping before starting using:<br />
For Each col As DataColumn In SourceDataTable<br />
 bulkData.ColumnMappings.Add(col.ColumnName, col.ColumnName)<br />
Next</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praxy</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-148758</link>
		<dc:creator>Praxy</dc:creator>
		<pubDate>Wed, 25 Mar 2009 12:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-148758</guid>
		<description>can any one help me to achieve the method 3

Itwould be good if any one one of u give me detailed steps to achive this.
because i am new into this . net stream.

Please 

Thanks in advance
Prasanna KJ</description>
		<content:encoded><![CDATA[<p>can any one help me to achieve the method 3</p>
<p>Itwould be good if any one one of u give me detailed steps to achive this.<br />
because i am new into this . net stream.</p>
<p>Please </p>
<p>Thanks in advance<br />
Prasanna KJ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praxy</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-148434</link>
		<dc:creator>Praxy</dc:creator>
		<pubDate>Mon, 23 Mar 2009 11:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-148434</guid>
		<description>Please some one help me out ....

i have code modified some thing like this 

 Sub method3()
        Dim i As Long = 0
        Dim dbConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;TEST_DB&quot;).ToString())
        Dim sr As StreamReader = New StreamReader(&quot;D:\MSPLNYERXX&quot;)
        Dim line As String = sr.ReadLine()

        Dim strArray As String() = line.Split(&quot;&#124;&quot;c)
        Dim dt As DataTable = New DataTable()
        Dim row As DataRow

        For Each s As String In strArray
            dt.Columns.Add(New DataColumn())
        Next

        Do

            row = dt.NewRow()
            row.ItemArray = line.Split(&quot;,&quot;c)

            dt.Rows.Add(row)

            i = i + 1
            line = sr.ReadLine()

        Loop While Not line = String.Empty

        Dim bc As SqlBulkCopy = New SqlBulkCopy(dbConn, SqlBulkCopyOptions.TableLock, Nothing)
        bc.DestinationTableName = &quot;MSPLNYERX&quot;

        bc.BatchSize = dt.Rows.Count

        dbConn.Open()
        bc.WriteToServer(dt)
        dbConn.Close()
        bc.Close()
    End Sub


can any one tell me what is going wrong
.. ihave used this in my script component task

 BUt Unluckly i have encounterd with the following error :(
Error: The script files failed to load.</description>
		<content:encoded><![CDATA[<p>Please some one help me out &#8230;.</p>
<p>i have code modified some thing like this </p>
<p> Sub method3()<br />
        Dim i As Long = 0<br />
        Dim dbConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings(&#8220;TEST_DB&#8221;).ToString())<br />
        Dim sr As StreamReader = New StreamReader(&#8220;D:\MSPLNYERXX&#8221;)<br />
        Dim line As String = sr.ReadLine()</p>
<p>        Dim strArray As String() = line.Split(&#8220;|&#8221;c)<br />
        Dim dt As DataTable = New DataTable()<br />
        Dim row As DataRow</p>
<p>        For Each s As String In strArray<br />
            dt.Columns.Add(New DataColumn())<br />
        Next</p>
<p>        Do</p>
<p>            row = dt.NewRow()<br />
            row.ItemArray = line.Split(&#8220;,&#8221;c)</p>
<p>            dt.Rows.Add(row)</p>
<p>            i = i + 1<br />
            line = sr.ReadLine()</p>
<p>        Loop While Not line = String.Empty</p>
<p>        Dim bc As SqlBulkCopy = New SqlBulkCopy(dbConn, SqlBulkCopyOptions.TableLock, Nothing)<br />
        bc.DestinationTableName = &#8220;MSPLNYERX&#8221;</p>
<p>        bc.BatchSize = dt.Rows.Count</p>
<p>        dbConn.Open()<br />
        bc.WriteToServer(dt)<br />
        dbConn.Close()<br />
        bc.Close()<br />
    End Sub</p>
<p>can any one tell me what is going wrong<br />
.. ihave used this in my script component task</p>
<p> BUt Unluckly i have encounterd with the following error :(<br />
Error: The script files failed to load.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praxy</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-148433</link>
		<dc:creator>Praxy</dc:creator>
		<pubDate>Mon, 23 Mar 2009 11:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-148433</guid>
		<description>Hi i am getting following error .....

Error: The script files failed to load.</description>
		<content:encoded><![CDATA[<p>Hi i am getting following error &#8230;..</p>
<p>Error: The script files failed to load.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/comment-page-1/#comment-148419</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 23 Mar 2009 09:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/#comment-148419</guid>
		<description>hi ia m facing problem with this
 as i am new to vb.net stream</description>
		<content:encoded><![CDATA[<p>hi ia m facing problem with this<br />
 as i am new to vb.net stream</p>
]]></content:encoded>
	</item>
</channel>
</rss>
