Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you should have a look into these tutorials,</p> <p>[<a href="http://www.asp.net/learn/data-access/][1]" rel="nofollow noreferrer">http://www.asp.net/learn/data-access/][1]</a></p> <p>All the work you are planning is already been done.</p> <p>have a look at this way of doing same what you are doinng</p> <pre><code> string preparedCommand = @"SELECT TOP 1 [SomeColumn],[SomeColumn2], [SomeColumn3] FROM [Database].[dbo].[Table] WHERE [SomeOtherColumn] = @varValue"; [1]: http://www.asp.net/learn/data-access/ </code></pre> <p>More better way of doing the same above is by Using LINQ TO SQL </p> <pre><code>var result = from someObject in SomeTable where SomeColumnHasValue == ValueToCompare select new { SomeColumn, SomeColumn1, SomeColumn2}; </code></pre> <ul> <li>No Type Safety Issues</li> <li>Visualise Database in C# while you work on it</li> <li>at compile time less errors</li> <li>less code</li> <li>more productive</li> </ul> <p>Following are some of the great resources for LINQ if you are interested</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx</a></li> <li><a href="http://www.hookedonlinq.com/MainPage.ashx" rel="nofollow noreferrer">http://www.hookedonlinq.com/MainPage.ashx</a></li> <li><a href="https://stackoverflow.com/questions/47740/what-are-some-good-linq-resouces">https://stackoverflow.com/questions/47740/what-are-some-good-linq-resouces</a></li> </ul> <p>Hope it helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload