0

我正在尝试填充此 gridview :

<asp:GridView ID="gvReportingStockComp" runat="server">

<Columns>

<asp:BoundField DataField="cod_wo" HeaderText="N° OF" />
<asp:BoundField DataField="composant" HeaderText="Composant" />
<asp:BoundField DataField="besoin" HeaderText="Besoin/OF" />

</Columns>

</asp:GridView>

在 C#~ 后面有一个代码,但我不知道什么不能用它:

OracleConnection oConnexion = new OracleConnection();
oConnexion.ConnectionString = "X";
oConnexion.Open();

string requete = SELECT cod_wo, composant, ROUND((wo_qty / (qty_revue * qte_besoin)) - qte_assignee,2) \"BESOIN\" FROM w";

OracleCommand cmdReqStockComp = new OracleCommand(requete);
cmdReqStockComp.Connection = oConnexion;
OracleDataReader readerReqStockComp = cmdReqStockComp.ExecuteReader();

gvReportingStockComp.DataSource = readerReqStockComp;
gvReportingStockComp.DataBind();

oConnexion.Close();
oConnexion.Dispose();

离奇

4

1 回答 1

0

requete 需要在引号中。

string requete = "SELECT cod_wo, composant, ROUND((wo_qty / (qty_revue * qte_besoin)) - qte_assignee,2) \"BESOIN\" FROM w";
于 2013-06-19T14:54:36.987 回答