I'm about to ask a super basic question, but I have googled for hours on end and have yet to find a satisfactory tutorial.
Basically, I just need to access my SQL Server database via a WebPart in SharePoint. I'm using Visual Studio 2010 to code my WebPart in Visual C#, but have yet to get anywhere further than the following code:
DataSet dataSet = null;
String connectionString = "server=WIN-JAU77JEK513;User ID=WIN-JAU77JEK513/Administrator;Password=;database=db;Connection Timeout=60";
SqlConnection conn = new SqlConnection(connectionString);
String query = "SELECT * FROM dbo.table;";
conn.Open();
And that's all I got. I'm just trying to figure out basic ways of querying and updating the database, nothing fancy or anything. Can someone point me to an easy-to-understand tutorial or post me some snippets of code? I'm completely new to C# programming (having never touched it before two days ago), so I would appreciate it if there are comments or something to help me understand better.