There may be some reason or requirement for the developer to interact with data source from the code, that is, for manipulating a data source from managed code. A data source is a data structure that has information about a specific data file or database. We may have different requirements, such as manipulating data using the data source information. Or we may need to work extensively on a process before sending it to a data source. Anything like this may need various kinds of data source interaction using code.
Let's take a different scenario — how Microsoft SQL Server connects to InfoPath and manipulates the data in the InfoPath form and explain it by way of a demonstration. Populating InfoPath form fields with data returned by the SQL database is not a difficult task, but the scenario is how we are going to manipulate the secondary data source from inside the InfoPath form, and how we are going to manage the data inside the form. And this is not the only scenario...