火鸟呼叫Gridview

本文关键字:Gridview 呼叫 火鸟 | 更新日期: 2023-09-27 18:07:54

我试图加载火鸟结果到asp.net gridview,但它不加载任何东西。我做错了什么:我所要做的就是在混合动力中运行SP,发送参数并在GridView中显示结果。

public void BindGridview()
{
    try
    {
    transportFbConn.Open();
    if (transportFbConn.State == ConnectionState.Closed)
    {
        transportFbConn.Open();
    }
    FbTransaction ft = transportFbConn.BeginTransaction();
    transportFbCommand = new FbCommand("EXECUTE PROCEDURE SPB_PNM_SO_HIST(@PNM)", transportFbConn, ft);
    transportFbCommand.CommandType = CommandType.StoredProcedure;
    transportFbCommand.Parameters.Add("@PNM", FirebirdSql.Data.FirebirdClient.FbDbType.Integer, 9999999, "PNM_AUTO_KEY").Direction = ParameterDirection.Input;
    transportFbCommand.Parameters[0].Value = Convert.ToInt32(Server.HtmlEncode(this.TextBox1.Text));
    FbDataAdapter da = new FbDataAdapter(transportFbCommand);
    DataSet ds = new DataSet();
    da.Fill(ds);
    GridView1.DataSource = ds;
    GridView1.DataBind();
}
catch (Exception ex)
{
    this.ErrorLabel.Text = (ex.Message);
}
finally
{
    transportFbConn.Close();
}

}

火鸟呼叫Gridview

Mark的回复帮了我的忙,我改用了Select * form Store Procedure (@parameter)