Note that there are some explanatory texts on larger screens.

plurals
  1. POADO.net without writing SQL (esp. WHERE)
    text
    copied!<p>I have this idea that using SQL VIEWS to abstract simple database computations (such as a count on a relation) is sufficient, and you don't need procedures (== procedural code)</p> <p>A simple sql <strong><em>view</em></strong> + a <strong><em>where</em></strong> clause >> a stored procedure with parameters sometimes</p> <p>While making this point I imagined a way of retrieving table/view data without writing SQL and without writing the where clause..</p> <p>But, to my surprise, there does not seem a way to accomplish this in ADO.NET 2.0 or later.</p> <p>Let me tell you what I tried:</p> <ul> <li><p>SqlDataAdapter + SqlCommandBuilder still requires you to write "SELECT ... FROM" and the <strong>WHERE CLAUSE</strong> in strings (plus, if you put the 'where', you dont have much use of Update/Insert/DeleteCommand)</p></li> <li><p>typed DataSets only allow you to retrieve _entire DataTable_s and then applying filters to them. Filters are strings, without escaping aid... (must double the single quote!)</p></li> <li><p>SQL to Entities looked promising but they seem to: be limited to MSSQL, generate bloated SQL queries, generate a whole new stack of DAOs (besides the existing Domain Model classes), reqiuire .net 3.5+ for all this etc. (that is, all these are disadvantages for me)</p></li> </ul> <p>Other ORMs have similar problems as SQL to Entities.</p> <p>What I'm looking for is a strong-typed method of accessing database tables/<strong><em>views</em></strong> that:</p> <ul> <li>doesn't come with another set of DAOs (K.I.S.S)</li> <li>allows me to query a table without writing "SELECTs" in strings (strong-typed)</li> <li>allows me to filter(<strong><em>WHERE</em></strong>) a table with properly-escaped parameters (and without retrieving the whole data beforehand)</li> <li>can later issue updates/inserts/deletes</li> </ul> <p>I am fairly new to .Net but not stupid: does this exist?</p> <p>Thanks.</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