显示基于学生ID的成绩表控件 [英] display marks chart control based on student id

查看:54
本文介绍了显示基于学生ID的成绩表控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨......

我的程序中有一个图表控件,它按主题显示学生成绩...
但是它只显示一个学生价值..
我想根据学生证显示该图表,我们必须在文本框中输入该图表.
请帮助我...

hi....

I have a chart control in my program it displays student marks subject wise...
But it displays only one student value..
I want to display that chart based on student id which one we have to entered in the textbox.
pls help me...

推荐答案

<pre lang="c#">
protected void BindData()
    {
        con.Open();
        SqlCommand cm = new SqlCommand("Select Marks from Student where StuId=@StuId", con);
        cm.Parameters.AddWithValue("@StuId", txtId.Text);
        SqlDataAdapter da1 = new SqlDataAdapter(cm);
        DataSet ds1 = new DataSet();
        da1.Fill(ds1,"Student");
        Chart1.DataSource = ds1.Tables[0];
        Chart1.DataBind();
        con.Close();
    }


并设置系列的图表属性
x:主题
Y:标记


And set the Chart Properties for Series
x:Subject
Y:Marks


从您所说的看来,您似乎是将一个学生对象而不是student [](学生对象数组)绑定到控件上.
From what you say it seems like you are binding a student object to the control instead of a student[] (student object array).


这篇关于显示基于学生ID的成绩表控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆