flash的问题
前台:
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="200">
<param name="movie" value='./Flash/<%=flashTable.Rows[0][0].ToString() %>' />
</object>
<tr>
<td>
<asp:HyperLink ID="A" runat="server" NavigateUrl="~/Default5.aspx?SubjectId=34568&theOption=A">A</asp:HyperLink><asp:CheckBox runat="server" ID="cha01" /></td>
<td>
<asp:HyperLink ID="B" runat="server" NavigateUrl="~/Default5.aspx?SubjectId=34568&theOption=B">B</asp:HyperLink><asp:CheckBox runat="server" ID="CheckBox1" /></td>
<td>
<asp:HyperLink ID="C" runat="server" NavigateUrl="~/Default5.aspx?SubjectId=7878111&theOption=C">C</asp:HyperLink><asp:CheckBox runat="server" ID="CheckBox2" /></td>
<td>
<asp:HyperLink ID="D" runat="server" NavigateUrl="~/Default5.aspx?SubjectId=44000&theOption=D">D</asp:HyperLink><asp:CheckBox runat="server" ID="CheckBox3" /></td>
</tr>
后台:
protected void Page_Load(object sender, EventArgs e)
{
string subjectId = Request.QueryString["SubjectId"];
string theOption = Request.QueryString["theOption"];
if (!IsPostBack)
{
if (subjectId == null)
{
myConnection.Open();
subjectId = "8787";
theOption = "A";
flashTable = DisplayFlash(subjectId, theOption);
Response.Write(subjectId);
Response.Write(theOption);
}
else
{
myConnection.Open();
Response.Write(subjectId);
Response.Write(theOption);
flashTable = DisplayFlash(subjectId, theOption);
}
}
}
private DataTable DisplayFlash(string subjectId,string theOption)
{
string sql = "select FlashName From answer where subjectId ="+subjectId+"and theoption = '"+theOption+"'";
SqlCommand comm = new SqlCommand(sql,myConnection);
SqlDataReader reader = comm.ExecuteReader();
DataTable table = new DataTable();
table.Load(reader);
return table;
}
程序报错
在位置 0 处没有任何行。(<%=flashTable.Rows[0][0].ToString() %>)