sql - Retrieving Data in Webmatrix without 'foreach' -


i want retrieve single item of data database use value input element. using below retrieve each instance of submittedby in db results in multiple results.

var userid = websecurity.currentuserid;  var db = database.open("testdb"); var selectquerystring = "select submittedby posts userid=@0";  var data = db.query(selectquerystring, userid);  @foreach(var row in data) {     <input type="email" name="emailfrom" id="emailfrom" value="@submittedby"/>   } 

how retrieve submittedby gives 1 result i.e. without foreach loop?

thanks in advance!!!

if data restriccions going obtain 1 , 1 value specific userid, use

   var submyttedvalue = db.queryvalue(selectquerystring, userid); 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -