Should I just use ADO.NET to directly access the underlying data in the database or does .NET have a better way to do this?
I am currently using SharePoint 2007 but we are about to move to 2010. I am using Visual Studio 2010.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would highly recommend using the SharePoint objects for accessing data (either SP* classes, or using SharePoint web services, LINQ to SharePoint etc).
Don’t directly access the underlying database using pure ADO.NET. The main reason is that, by using the supported (official) way of accessing data, you lessen the risk of causing problems. For example, when changing data in a table, you don’t know if there is a mandatory requirement for another table in the database to be updated also. The SharePoint objects will take care of that for you.
Plus, I think Microsoft will not support issues with your SharePoint code if it’s directly accessing the database and there is a risk your code may not execute after any hot fix or SP release as Microsoft may change the Database structure any time .