SqlDataAdapter da = new SqlDataAdapter(" select 题号,题目,答案,A,B,C,D from 单选题 where EXISTS (select * from "+paperTitl+" where "+paperTitl+".questionID=单选题.题号 and questionType='单选题')",conn);
DataSet ds=new DataSet();
da.Fill(ds,"danxuan");
ds.Tables["danxuan"].Columns.Add(new DataColumn("题目号",typeof(int)));
for(int i=0;i<ds.Tables["danxuan"].Rows.Count;i++)
{
ds.Tables["danxuan"].Rows[i]["题目号"]=i+1;
}
DataGrid1.DataSource=ds.Tables["danxuan"].DefaultView;
DataGrid1.DataBind();
这是datagrid填充的数据
在 DataGrid1_EditCommand里对选中的某题,把其题号传到另一页面
int mrId;
mrId=int.Parse(e.Item.Cells[0].Text.Trim());
Response.Redirect(sFormAction+"ID="+mrId+"");
总是无法传到
提示:输入字符串的格式不正确。
DataSet ds=new DataSet();
da.Fill(ds,"danxuan");
ds.Tables["danxuan"].Columns.Add(new DataColumn("题目号",typeof(int)));
for(int i=0;i<ds.Tables["danxuan"].Rows.Count;i++)
{
ds.Tables["danxuan"].Rows[i]["题目号"]=i+1;
}
DataGrid1.DataSource=ds.Tables["danxuan"].DefaultView;
DataGrid1.DataBind();
这是datagrid填充的数据
在 DataGrid1_EditCommand里对选中的某题,把其题号传到另一页面
int mrId;
mrId=int.Parse(e.Item.Cells[0].Text.Trim());
Response.Redirect(sFormAction+"ID="+mrId+"");
总是无法传到
提示:输入字符串的格式不正确。
解决方案 »
- in2bits.MyXls 如何设定行高?
- ASP.NET如何利用任何手段把Excel转换成图片显示在网页上?
- 请问如何让Js可以访问到C# 的对象呢?
- 求助:Details控件的编辑以及更新实现..&如何将Details中的Dropdownlist选定为指定值?
- 有没有办法将excel以打印预览的方式在页面里打开?
- 在Asp.Net中请问这种对话框如何实现
- !问个入门的问题
- 新手:请问当用户登录进去后如何制作修改个人信息页面?
- 如何把ADO.net格式的数据转换成ADO格式?
- 关于弹出框的控制问题
- 做搜索企业相关信息的搜索引擎应该用到什么技术?
- 如何把一个用户控件的属性定义为Bindable(可绑定),可以在绑定的属性页可见,应该在属性前面加什么修饰
int mrId;
mrId=int.Parse(e.Item.Cells[0].Text.Trim());
Response.Redirect(sFormAction+"ID="+mrId+"");
晕倒,有你这么做的吗?
editCommand是使单元格处于可编辑状态
你应该用超级链接列,把主键以URL参数传到另外一个页面,再来获取其它属性。