ATM系统查询余额.doc
上传人:sy****28 上传时间:2024-09-13 格式:DOC 页数:2 大小:18KB 金币:14 举报 版权申诉
预览加载中,请您耐心等待几秒...

ATM系统查询余额.doc

ATM系统查询余额.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

14 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

文章选自:http://www.cha-doo.comPAGE\*MERGEFORMAT2参考资料:sqlserver数据库原理与开发HYPERLINK"http://www.crizome.com"哈尔滨白癜风医院ATM系统查询余额DBHelp.cs中的内容:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Data.SqlClient;namespaceATM{classDBHelp{publicstaticSqlConnectionconnection=newSqlConnection("datasource=.\\sqlexpress;database=ATM_System;integratedsecurity=true");}}Select_Sal查询余额:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceATM{publicpartialclassSelect_Bal:Form{publicSelect_Bal(){InitializeComponent();}privatevoid返回ToolStripMenuItem_Click(objectsender,EventArgse){Operateo=newOperate();o.Show();this.Hide();}///<summary>///查询余额///1、从表ATM_Money中查询出余额///</summary>///<paramname="sender"></param>///<paramname="e"></param>privatevoidSelect_Bal_Load(objectsender,EventArgse){DBHelp.connection.Open();stringcommand="selectbalancefromATM_Moneywhereaccount='"+Login.account+"'";SqlCommandcomm=newSqlCommand(command,DBHelp.connection);label1.Text="您当前账户余额为:"+comm.ExecuteScalar().ToString()+"元";DBHelp.connection.Close();}}}