<p>I need to learn ADO.NET to build applications based on MS Office. I have read a good deal about ADO.NET in the MSDN Library, but everything seems rather messy to me.</p>

<p>What are the basics one must figure out when using ADO.NET? I think a few key words will suffice to let me organize my learning.</p>

[{'answer_id': 4204, 'author': 'Karl Seguin', 'author_id': 34, 'author_profile': 'https://Stackoverflow.com/users/34', 'pm_score': 4, 'selected': True, 'text': '<p>There are three key components (assuming ur using SQL server):</p>\n\n<ul>\n<li><code>SQLConnection</code></li>\n<li><code>SqlCommand</code></li>\n<li><code>SqlDataReader</code></li>\n</ul>\n\n<p>(if you\'re using something else, replace <code>Sql</code> with "Something", like <code>MySqlConnection</code>, <code>OracleCommand</code>)</p>\n\n<p>Everything else is just built on top of that.</p>\n\n<p><strong>Example 1:</strong></p>\n\n<pre><code>using (SqlConnection connection = new SqlConnection("CONNECTION STRING"))\nusing (SqlCommand command = new SqlCommand())\n{\n  command.commandText = "SELECT Name FROM Users WHERE Status = @OnlineStatus";\n  command.Connection = connection;\n  command.Parameters.Add("@OnlineStatus", SqlDbType.Int).Value = 1; //replace with enum\n  connection.Open();\n\n  using (SqlDataReader dr = command.ExecuteReader))\n  {\n      List&lt;string&gt; onlineUsers = new List&lt;string&gt;();\n\n      while (dr.Read())\n      {\n         onlineUsers.Add(dr.GetString(0));\n      }\n  }\n}\n</code></pre>\n\n<p><strong>Example 2:</strong></p>\n\n<pre><code>using (SqlConnection connection = new SqlConnection("CONNECTION STRING"))\nusing (SqlCommand command = new SqlCommand())\n{\n  command.commandText = "DELETE FROM Users where Email = @Email";\n  command.Connection = connection;\n  command.Parameters.Add("@Email", SqlDbType.VarChar, 100).Value = "user@host.com";\n  connection.Open();\n  command.ExecuteNonQuery();\n}\n</code></pre>\n'}, {'answer_id': 14218, 'author': 'Mark Cidade', 'author_id': 1659, 'author_profile': 'https://Stackoverflow.com/users/1659', 'pm_score': 0, 'selected': False, 'text': "<p>Another way of getting a command object is to call <code>connection.CreateCommand()</code>. </p>\n\n<p>That way you shouldn't have to set the <code>Connection</code> property on the command object. </p>\n"}]
['https://Stackoverflow.com/questions/4170', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']