日期:2014-05-18 浏览次数:21002 次
<asp:GridView ID="GridView6" runat="server" Width="100%" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3"> <Columns> <asp:TemplateField HeaderText="综合题"> <ItemTemplate> <table id="Table7" cellspacing="1" cellpadding="1" width="100%" align="center" border="0"> <tr> <td> <asp:Label id="Label24" runat="server" Text='<%# Container.DataItemIndex+1 %>'> </asp:Label> <asp:Label id="Label25" runat="server" Text='<%# Eval("Title","、{0}") %>'>(报错的地方) </asp:Label> <asp:TextBox id="txtAnswer1" runat="server" Width="100%" TextMode="MultiLine"></asp:TextBox> <asp:Label id="Label26" runat="server" Text='<%# Eval("ID") %>' Visible="False"> </asp:Label> </td> </tr> </table> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
SqlParameter[] Params6 = new SqlParameter[2]; Params6[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID); //试卷编号 Params6[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "综合题"); //题目类型 DataSet ds6 = DB.GetDataSet("Proc_PaperDetail", Params6); GridView6.DataSource = ds6; GridView6.DataBind();
public DataSet GetDataSet(string ProcName, SqlParameter[] Params) { Open(); SqlCommand Cmd = CreateCommand(ProcName, Params); SqlDataAdapter adapter = new SqlDataAdapter(Cmd); DataSet dataset = new DataSet(); adapter.Fill(dataset); Close(); return dataset; }