Using SqlCommands and SqlParameters
After you create the SQL statements in your code, how do you actually send the statements or commands to the database? The answer depends on the Data Provider your application is using. You have the option of using the OLEDB Data Provider or the SQL Server Data Provider. There will probably be other Data Providers made available in the future as well.
If you want to use the SQL Server Data Provider, you should use the classes defined in the System.Data.SqlClient namespace. If you want to use the OLEDB Data Provider, you should use the classes defined in theSystem.Data.OleDb namespace. And, if you want to write code that does not assume any particular Data Provider you would use the interfaces defined in System.Data ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access