第一范文网 - 专业文章范例文档资料分享平台

奖学金评定大学本科毕业论文(3)

来源:用户分享 时间:2018-10-25 本文由离人怎挽 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

SqlCommand cmd = new SqlCommand(); cmd.Connection = conn;

cmd.CommandText = count(*) from 用户表 where 账号=\'+TextBox1.Text .Trim () + 密码=\' int n = Convert.ToInt16(cmd.ExecuteScalar());

2.3.2 审核评价代码设计

int sum = 0;

SqlConnection conn = new SqlConnection();

conn.ConnectionString = Source=.;Initial Catalog=ZHCP;Integrated Security=sspi

conn.Open();

SqlCommand cmd = new SqlCommand(); cmd.Connection = conn;

cmd.CommandText = count(*) from 用户表 where 账号=\'+TextBox1.Text .Trim () + 密码=\' int n = Convert.ToInt16(cmd.ExecuteScalar());

public void p2() //获取品德分,附加分并显示在文本框中

第 10 页 共 19 页

{

conn = new SqlConnection();

conn.ConnectionString = Source=.;Initial Catalog=ZHCP;Integrated Security=sspi

conn.Open();

cmd = new SqlCommand(); cmd.Connection = conn;

cmd.CommandText = 成绩信息表 set 品德分=+ Convert.ToSingle(TextBox10.Text) + 附加加分=+ Convert.ToSingle(TextBox12.Text) + 综合分=+ Convert.ToSingle(TextBox13.Text) + 学号 =\'学年=\'

cmd.ExecuteNonQuery(); conn.Close();

}

2.3.3 学生管理代码设计

public partial class 教师_学生管理 : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string username = Convert.ToString(Session[ TextBox1.Text = username; }

public void prompt() {

conn = new SqlConnection();

conn.ConnectionString = ity=sspi

conn.Open();

DataSet ds = new DataSet();

string ss = 学生信息表

SqlDataAdapter da= new SqlDataAdapter(ss,conn); da.Fill(ds);

if (ds.Tables[0].Rows.Count == 0)

第 11 页 共 19 页

{

DataRow dr = ds.Tables[0].NewRow(); ds.Tables[0].Rows.Add(dr); }

GridView1.DataSource = SqlDataSource2;

GridView1.DataKeyNames = new string[] {学号 GridView1.DataBind(); }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) {

this.TextBox1.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.TextBox2.Text = this.GridView1.SelectedRow.Cells[1].Text.ToString(); this.TextBox3.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.TextBox4.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox5.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.TextBox7.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox8.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.TextBox9.Text = this.GridView1.SelectedRow.Cells[9].Text.ToString(); }

SqlConnection conn; SqlCommand cmd;

protected void Button2_Click(object sender, EventArgs e) {

conn = new SqlConnection();

conn.ConnectionString = ity=sspi

conn.Open();

cmd = new SqlCommand(); cmd.Connection = conn; string insert = 学生信息表 values(\'TextBox4.Text + + cmd.CommandText = insert; cmd.ExecuteNonQuery(); prompt();

Response.Write(信息添加成功!\') }

protected void Button3_Click(object sender, EventArgs e) {

SqlConnection conn = new SqlConnection();

conn.ConnectionString = ity=sspi

第 12 页 共 19 页

conn.Open();

string strsql = 学生信息表 set 学号=\'班级=\'姓名=\'性别=\'职务=\'入学时间=\'专业=\'联系电话=\'宿舍=\'学号=\' SqlCommand cmd = new SqlCommand(strsql, conn); cmd.ExecuteNonQuery();

Response.Write(信息修改成功!\') }

protected void Button4_Click(object sender, EventArgs e) {

conn = new SqlConnection();

conn.ConnectionString = ity=sspi

conn.Open();

cmd = new SqlCommand(); cmd.Connection = conn;

string sqldelete = 学生信息表 where 学号=\' cmd.CommandText = sqldelete; cmd.ExecuteNonQuery();

Response.Write(信息删除成功!\') } }

2.4 数据库配置文件

\\Windows\\Microsoft.Net\\Framework\\v2.x\\Config 中 -->

通过 节可以配置 ASP.NET 使用的 安全身份验证模式, 以标识传入的用户。 -->

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新高等教育奖学金评定大学本科毕业论文(3)全文阅读和word下载服务。

奖学金评定大学本科毕业论文(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/2734.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top