title: Pass Null Values In A SQL Command (For Two Columns) - Adding In Foreach Loop
body: <p>I want to select rows from my SQL Server table (it has <code>3</code> columns) and to display them into my Datagridview. My problem about null values. How can I pass null values? (Sometimes the first column and the second column are empty.
  ). </p>
  
  <p>Below is my code:</p>
  
  <pre><code>    string cm = "SELECT column1, column2, column3 FROM mytablename WHERE column1='" 
     + sIS[mSI] + "' AND column2='" + sR[mSSI] + "' OR column1='" + sR[mSSI] 
     + "' AND column2='" + sIS[mSI] + "'";
  </code></pre>
  
  <p>Note: I edited my code.</p>