<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Discussions by mikep</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/mikep/Discussions/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 - Discussions by mikep</title>
		<link>http://channel9.msdn.com/Niners/mikep/Discussions</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Niners/mikep/Discussions</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 12:52:22 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 12:52:22 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>0</c9:totalResults>
	<c9:pageCount>0</c9:pageCount>
	<c9:pageSize>0</c9:pageSize>
	<item>
		<title>Tech Off - ADO.Net feature request</title>
		<description><![CDATA[<p>Thanks for the post!<br>
<br>
As has been observed, this can be achieved using TableMappings, for example, the following code writes out the table names &quot;Customers&quot; and &quot;Orders&quot;:<br>
<br>
<p>SqlConnection sqlConn = new SqlConnection(connString);<br>
SqlDataAdapter sqlAdapter =&nbsp;<br>
&nbsp;&nbsp;&nbsp;new SqlDataAdapter(&quot;SELECT * FROM Customers;SELECT * FROM Orders&quot;, sqlConn);<br>
sqlAdapter.TableMappings.Add(&quot;Table&quot;,&quot;Customers&quot;);<br>
sqlAdapter.TableMappings.Add(&quot;Table1&quot;,&quot;Orders&quot;);</p>
<p>DataSet ds = new DataSet();<br>
sqlAdapter.Fill(ds);<br>
foreach(DataTable t in ds.Tables)<br>
&nbsp;&nbsp;&nbsp;Console.WriteLine(t.TableName);</p>
<p>Alternatively, in ADO.NET 2.0 we added a Load() command that allows you to directly load a datatable or dataset from any datareader, without requiring you to create a DataAdapter.&nbsp; The Load() command does take an optional string of tablenames, so you could
 write the code as follows:<br>
<br>
SqlConnection sqlConn = new SqlConnection(connString);<br>
DataSet ds2 = new DataSet();<br>
SqlCommand command =&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new SqlCommand(&quot;SELECT * FROM Customers;SELECT * FROM Orders&quot;,sqlConn);<br>
sqlConn.Open();<br>
SqlDataReader reader = command.ExecuteReader;(CommandBehavior.CloseConnection);<br>
ds2.Load(reader,LoadOption.OverwriteChanges,&quot;Customers2&quot;,&quot;Orders2&quot;);<br>
foreach(DataTable t in ds2.Tables)<br>
&nbsp;&nbsp;&nbsp;Console.WriteLine(t.TableName);<br>
<br>
Given this direct mechanism, and a desire to avoid having too many overloads, we decided not to add another variation of overloads to Fill.<br>
<br>
We could certainly revisit this decision if people feel this scenario is common/important enough to justify additional overloads, but our general feeling was that having too many overloads made the API more confusing.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/211792-ADONet-feature-request/ce453c3963164504b21e9dea014455d0#ce453c3963164504b21e9dea014455d0</link>
		<pubDate>Tue, 18 Jul 2006 21:33:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/211792-ADONet-feature-request/ce453c3963164504b21e9dea014455d0#ce453c3963164504b21e9dea014455d0</guid>
		<dc:creator>mikep</dc:creator>
		<slash:comments>15</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/mikep/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>