<?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>RedSouljaz Blog &#187; Accesing CommandTimeout properties in a TableAdapter</title>
	<atom:link href="http://redsouljaz.com/tag/accesing-commandtimeout-properties-in-a-tableadapter/feed/" rel="self" type="application/rss+xml" />
	<link>http://redsouljaz.com</link>
	<description>My Personal Blog&#039;s</description>
	<lastBuildDate>Mon, 25 Apr 2011 09:17:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to set command Timeout for getData() in TableAdapter</title>
		<link>http://redsouljaz.com/2010/02/04/how-to-set-command-timeout-for-getdata-in-tableadapter/</link>
		<comments>http://redsouljaz.com/2010/02/04/how-to-set-command-timeout-for-getdata-in-tableadapter/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 04:26:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Accesing CommandTimeout properties in a TableAdapter]]></category>
		<category><![CDATA[CommandTimeout property]]></category>
		<category><![CDATA[dataset]]></category>
		<category><![CDATA[How to set command Timeout for getData in TableAdapter]]></category>
		<category><![CDATA[set commandTimeout in TableAdapter]]></category>
		<category><![CDATA[TableAdapter]]></category>
		<category><![CDATA[xsd]]></category>

		<guid isPermaLink="false">http://redsouljaz.com/?p=304</guid>
		<description><![CDATA[One of the disadvantages when we using tableadapter to retrieve the data from database is they do not provide property to set command timeout (SHIT). This giving me a huge headache for my project which most of the entire project is using tableadapter instead of creating my own DAL or class.
After do some research on [...]]]></description>
			<content:encoded><![CDATA[<p>One of the disadvantages when we using tableadapter to retrieve the data from database is they do not provide property to set command timeout (SHIT). This giving me a huge headache for my project which most of the entire project is using tableadapter instead of creating my own DAL or class.<br />
After do some research on the internet, there is 1 ways to add command timeout in tableadapter dataset (.xsd file) which is</p>
<p>create new property inside partial class:<br />
Double click on xxxTableAdaper and it will show you behind code in .vb file of xsd file. Add this code inside Partial Public Class xxxDataTableAdapter</p>
<pre class="brush: vb;">
Namespace xxxTableAdapters
    Partial Public Class yyyTableAdapter
        Public WriteOnly Property CommandTimeout() As Integer
            Set(ByVal value As Integer)
                Dim i As Integer = 0
                While (i &lt; Me.CommandCollection.Length)
                    If (Me.CommandCollection(i) IsNot Nothing) Then
                        Me.CommandCollection(i).CommandTimeout = value
                    End If
                    i = (i + 1)
                End While
            End Set
        End Property
    End Class
End Namespace
</pre>
<p>And how you use it, you just add 1 line of code:</p>
<pre class="brush: vb;">
            Dim dt As New DataSet1TableAdapters.AddressTableAdapter
            dt.CommandTimeout = 120
            gridview1 = dt.GetData()
</pre>
<p>Notes:<br />
xxxTableAdapters , xxx you replace with the name of .xsd file<br />
yyyTableAdapter you replace with the name of table adapter</p>
<p>This code is tested in visual studio 2008 </p>
<p><a href="http://www.plus500.com/?id=21914&#038;pl=2&#038;tags=" target="_blank" title="Plus500"><img src="http://cdn.plus500.com/Media/Banners/728x90/439.gif" width="728" height="90" border="0" alt="Plus500" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://redsouljaz.com/2010/02/04/how-to-set-command-timeout-for-getdata-in-tableadapter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

