ASP+ACCESS 读取数据库里两个数据的差
这么个意思~: 表 A: id mark 1 20 2 10 要的是在Gridview里显示两个MARK的差 我实在写不出select 大家帮帮忙~~
使用奇偶来获得间隔行的数据,然后相减引用 若是偶数行减奇数行,代码如下: C# codeprotectedvoid GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {if (e.Row.RowType== DataControlRowType.DataRow) {if ((e.Row.RowIndex+1)%2==0 ) { GridView1.Rows[e.Row.RowIndex-1].Cells[5].Text= (Convert.ToInt32(e.Row.Cells[5].Text)- Convert.ToInt32(GridView1.Rows[e.Row.RowIndex-1].Cells[5].Text)).ToString(); } } } protected void Page_Load(object sender, EventArgs e) { OleDbConnection oc = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("db1.mdb")); oc.Open(); OleDbDataAdapter oa = new OleDbDataAdapter("select * from A", oc); DataSet ds = new DataSet(); oa.Fill(ds, "A"); GridView1.DataSource = ds; GridView1.DataBind(); oc.Close(); } 在这基础上怎么加你 的代码呐? 我想要的是在Gridview1上显示出来。谢谢 解决了,谢谢各位~~
相关问答:
function CheckOpwd(){//验证用户名 var pwd=document.all.txtOpwd; var div1=document.getElementById("divPwd"); if (pwd.value=="") { ......
<?xml version="1.0"?> <root> <status>433</status> <msg>这个是汉字</msg> <serialno>123</serialno> </root> 如何用ASP读取 status值 ......
C# code: SqlConnection conn = CsDB.sqlcon(); SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
3个radioButton 一个Button 一个label C# code: protected void Button1_Click(object sender, EventArgs e) { string str = null; RadioButton rdo=(RadioButton)sender; ......
asp.net批量上传图片最好有源码,在线等!!!!!!! 源码很长的。 参考 C# code: HttpFileCollection files = HttpContext.Current.Request.Files; if (files.Count <= 1) { ......