文件名称:数组排序c#资源共享
文件大小:16KB
文件格式:RAR
更新时间:2014-06-21 13:52:09
数组排序资源共享
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace TestA { public partial class LoginForm : Form { public LoginForm() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void btnLogin_Click(object sender, EventArgs e) { // 数据库连接字符串 string connString = "Data Source=A60361\\SQL2005;Initial Catalog=MySchool;User ID=sa;Pwd=111111"; // 创建 Connection 对象 SqlConnection connection = new SqlConnection(connString); // 打开数据库连接 connection.Open(); MessageBox.Show("打开数据库连接成功"); string sqlString = "select count(*) from student where loginid='" + this.tbLoginName.Text.Trim() + "' and loginpwd='" + this.tbLoginPwd.Text.Trim() + "'"; SqlCommand command = new SqlCommand(sqlString, connection); int num = (int)command.ExecuteScalar(); if (num == 1) { MessageBox.Show(this.tbLoginName.Text.Trim() + "登录成功!"); } else { MessageBox.Show(this.tbLoginName.Text.Trim() + "登录失败!请注册后再试!"); } // 关闭数据库连接 connection.Close(); //MessageBox.Show("关闭数据库连接成功"); } } }
【文件预览】:
数组排序
----ConsoleApplication1()
--------ConsoleApplication1()
--------ConsoleApplication1.sln(946B)
--------ConsoleApplication1.suo(11KB)