I would like to import a SQL Database into my site using C# code?
You can BCS (Business Connectivity Services) to pull out data from SQL Server or push data from SharePoint list to SQL Server tables. You just need to configure the service.
If you have simple tables, then you can export SQL table in excel. You can then actually create a new list with the import as spreadsheet option in SharePoint. Otherwise, write a powershell open sql connection and insert into SharePoint code effort but useful if you have complex data tables.
PowerShell is the easiest solution for this. Here is a link with some example code.
http://www.dotnetfunda.com/codes/show/6988/powershell-scripts-for-export-and-import-sharepoint-list-to-sql-table
You need these thing
- Visual Studio 2015 Update 3
- ASP.NET 4.5.2
- SQL Server
and they will easily solve your issue