Execute the SELECT statement and get the reader object data

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
lfernandes
User
Posts: 77

Execute the SELECT statement and get the reader object data

Post by lfernandes »

I installed the 12.0.4 version of ASP NET MAKER and am trying to use the global function Conn following the example var dr = conn.Execute ( "SELECT ..."); // Execute the SELECT statement and get the reader object data, but all attempts to retrieve the values ​​return error. Can help what should I do?

var dr = conn.Execute ( "SELECT [Codigo],[Nome],[CNPJ],[Endereco],[Numero],[Complemento],[DescBairro],[DescCidade],[DescEstado],[CEP],[Referencia],[Observacao],[Pagamento],[Prazo],[Embalagem],[IPI],[Frete],[Validade],[Garantia],[Contato],[Fone1],[Fone2],[EmailContato]FROM [ViewProposta] WHERE [IDProposta] = 29 ")
}

The error returned is as follows:

Description: Error compiling a resource required to service this request. Please review the specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'int' does not contain a definition for 'Fields' and no extension method 'Fields' accepting a first argument of type 'int' is found (you are not using a directive or assembly reference ?)

Source Error:
Line 90: </ div>
Line 91: <div class = "invoice-date">
Line 92: <strong> Proposal #: </ strong> @ Html.Raw (rs.Fields [ "name"] Value.) <br/>
Line 93:. <Strong> Rio de Janeiro, @dia of @mes of @ano </ strong>
Line 94: </ div>


motfs
User
Posts: 258

Post by motfs »

Conn.Execute("sql") will return int. If you want to get rows, use Conn.GetRows(<sql>) or Conn.GetRows(<dr>). See the function "GetRows" in aspxfn.cs.


Post Reply