tag:blogger.com,1999:blog-5503003700585906386.post800606734264678666..comments2024-03-11T00:12:37.389-07:00Comments on Sagi's Tech: Fast DataTable loading from IDataReaderUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5503003700585906386.post-89685389726985644062008-12-18T23:54:00.000-08:002008-12-18T23:54:00.000-08:00Loading to a DataTable can be done without this fu...Loading to a DataTable can be done without this function (using IDataAdapter), however, this function is faster.<BR/><BR/>A simple way to get IDataReader (I'm sketching here, didn't test this):<BR/>SqlConnection conn = new SqlConnection(connString);<BR/>SqlCommand cmd = conn.CreateCommand();<BR/>cmd.CommandText = "select getdate()";<BR/>IDataReader dr = cmd.ExecuteReader();<BR/><BR/>Don't forget to close everything (maybe with 'using')Sagihttps://www.blogger.com/profile/00834449218084481325noreply@blogger.comtag:blogger.com,1999:blog-5503003700585906386.post-62741730517211913152008-12-09T03:48:00.000-08:002008-12-09T03:48:00.000-08:00Sagi, loading a DataTable from an IDataReader list...Sagi, loading a DataTable from an IDataReader list is something I am trying to learn to do; this snippet looks like an answer to a probelm I've encountered, but I don't understand how to use this sample.<BR/><BR/>Could you give an example of how it is used, please?K. B. McHughhttps://www.blogger.com/profile/04272390881401118013noreply@blogger.com