GetAllPersons()http://forums.asp.net/t/1322338.aspx/1?GetAllPersons+Thu, 18 Sep 2008 22:18:46 -040013223382631295http://forums.asp.net/p/1322338/2631295.aspx/1?GetAllPersons+GetAllPersons() <p>In People.aspx&nbsp;</p> <p>&nbsp;===========================</p> <p>&nbsp;&lt;asp:ObjectDataSource ID=&quot;ObjectDataSource1&quot; runat=&quot;server&quot; SelectMethod=&quot;GetAllPersons&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TypeName=&quot;People&quot;&gt;&lt;/asp:ObjectDataSource&gt;</p> <p>============================&nbsp;</p> <p>in Class: People:&nbsp;</p> <p>============================&nbsp;</p> <p>&nbsp; public static class People {<br> <br> &nbsp;&nbsp;&nbsp; private static bool _isInitialized = false;<br> &nbsp;&nbsp;&nbsp; private static PeopleProvider _provider;<br> &nbsp;&nbsp;&nbsp; private static SmallBusinessDataProvidersSection _providersSection;<br> <br> &nbsp;&nbsp;&nbsp; public static PeopleProvider Provider {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Initialize();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _provider;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp; }<br> <br> &nbsp;&nbsp;&nbsp; public static List&lt;Person&gt; GetAllPersons()<br> &nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Provider.GetAllPersons();<br> &nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;=========================</p> <p>There are two GetAllPersons functions in: SqlPeopleProvider.cs and XmlPeopleProvider.cs, how the program knows go to which one? at the moment, it will use the function in: XmlPeopleProvider.cs, it must have some relationship with: Initialize(), but can you tell me how?</p> <p>Thanks</p> <p>JT&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2008-09-18T22:18:46-04:00