从一页面传递参数,在第二个页面的table表中显示出来。
现在在dbgrid显示没问题,但是在table中在html代码修改是出现问题
----------
编译器错误信息: CS0122: 'test.list1.dr' is inaccessible due to its protection level源错误:
行 25: </TR>
行 26: <TR class=folight>
行 27: <TD style="WIDTH: 310px" bgColor="#ccffff" colSpan="1" >3 <%=dr["content"]%></TD>
行 28: </TR>
行 29: </TABLE>
-----------------------------------------------
c代码如下
string strcoon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath("../data/bbs.mdb");
OleDbConnection myconn=new OleDbConnection(strcoon);
string str="select writer,title,content,w_time from write_content where id="+id;
//
OleDbDataAdapter myadapter=new OleDbDataAdapter(str,myconn);
ds=new DataSet();
myconn.Open();
myadapter.Fill(ds,"write_content");
dr=ds.Tables["write_content"].Rows[0];
subject.Text="re:"+dr["subject"].ToString();
现在在dbgrid显示没问题,但是在table中在html代码修改是出现问题
----------
编译器错误信息: CS0122: 'test.list1.dr' is inaccessible due to its protection level源错误:
行 25: </TR>
行 26: <TR class=folight>
行 27: <TD style="WIDTH: 310px" bgColor="#ccffff" colSpan="1" >3 <%=dr["content"]%></TD>
行 28: </TR>
行 29: </TABLE>
-----------------------------------------------
c代码如下
string strcoon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath("../data/bbs.mdb");
OleDbConnection myconn=new OleDbConnection(strcoon);
string str="select writer,title,content,w_time from write_content where id="+id;
//
OleDbDataAdapter myadapter=new OleDbDataAdapter(str,myconn);
ds=new DataSet();
myconn.Open();
myadapter.Fill(ds,"write_content");
dr=ds.Tables["write_content"].Rows[0];
subject.Text="re:"+dr["subject"].ToString();
高手们说得都没错不过,我觉得应该在你输出的地方放一个label,这样,就可以在代码里对label赋值就行了
就是说你先定义一个全局变量如Result,然后进行赋值运算,Result=dr["content"],然后再输出
<% =Result %>就可以了
Result=dr["content"];然后在 <TR class=folight>
<TD style="WIDTH: 310px" bgColor="#ccffff" colSpan="1" >3 <%=Result%></TD>