資源簡介
基于SQL數據庫和C#的學生成績查詢系統

代碼片段和文件信息
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;
using?System.Data.Common;
namespace?_0042335
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click_1(object?sender?EventArgs?e)
????????{
????????????if?(textBox1.Text.ToString().Trim()?!=?““?&&?textBox2.Text.ToString().Trim()?!=?““)
????????????{
????????????????String?commandText?=?“exec?usera?‘“?+?textBox1.Text.ToString().Trim()?+?“‘‘“?+?textBox2.Text.ToString().Trim()?+?“‘“;
????????????????try
????????????????{
????????????????????bool?temp?=?new?bool();
????????????????????temp?=?getFlag(commandText);
????????????????????if?(temp)
????????????????????{
????????????????????????this.Visible?=?false;
????????????????????????Form2?main?=?new?Form2();
????????????????????????main.Show();
????????????????????}
????????????????????else?MessageBox.Show(“用戶名或密碼輸入錯誤“);
????????????????}
????????????????catch?(Exception?ex)
????????????????{
????????????????????MessageBox.Show(ex.ToString()?“提示“);
????????????????}
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“請輸入用戶名和密碼“?“提示“);
????????????}
????????}
????????public?bool?getFlag(String?commandText)
????????{
????????????string?connectionString?=?@“Data?Source=127.0.0.1;Integrated?Catalog?=student;Integrated?Security=True“;
????????????SqlConnection?connection?=?new?SqlConnection(connectionString);
????????????{
????????????????connection.Open();
????????????????bool?flag?=?new?bool();
????????????????SqlCommand?cmdQuery?=?new?SqlCommand(commandText?connection);
????????????????SqlDataReader?reader?=?cmdQuery.ExecuteReader();
????????????????if?(reader.Read())?flag?=?true;
????????????????else?flag?=?false;
????????????????reader.Close();
????????????????connection.Close();
????????????????return?flag;
????????????}
????????}
??
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-06-17?16:42??基于SQL數據庫和C#的學生成績查詢系統\
?????目錄???????????0??2013-06-17?16:42??基于SQL數據庫和C#的學生成績查詢系統\10042335\
?????文件????????5549??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\10042335.csproj
?????文件?????????418??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\10042335.csproj.user
?????文件?????????904??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\10042335.sln
?????文件???????60416??2013-05-31?12:36??基于SQL數據庫和C#的學生成績查詢系統\10042335\10042335.suo
?????文件????????4686??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form1.Designer.cs
?????文件????????2255??2013-05-25?01:17??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form1.cs
?????文件????????5814??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form1.resx
?????文件????????6740??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form2.Designer.cs
?????文件????????1346??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form2.cs
?????文件????????6012??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form2.resx
?????文件????????6449??2013-05-25?00:59??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form3.Designer.cs
?????文件????????3403??2013-05-25?01:17??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form3.cs
?????文件????????5814??2013-05-25?00:59??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form3.resx
?????文件???????17286??2013-05-25?01:00??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form4.Designer.cs
?????文件????????9428??2013-05-25?01:18??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form4.cs
?????文件????????6012??2013-05-25?01:00??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form4.resx
?????文件???????16093??2013-05-25?01:00??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form5.Designer.cs
?????文件???????11257??2013-05-25?01:18??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form5.cs
?????文件????????6012??2013-05-25?01:00??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form5.resx
?????文件???????13552??2013-05-25?01:01??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form6.Designer.cs
?????文件????????4018??2013-05-25?01:19??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form6.cs
?????文件????????5814??2013-05-25?01:01??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form6.resx
?????文件???????17022??2013-05-25?01:02??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form7.Designer.cs
?????文件???????11346??2013-05-25?01:20??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form7.cs
?????文件????????6012??2013-05-25?01:02??基于SQL數據庫和C#的學生成績查詢系統\10042335\Form7.resx
?????文件?????????467??2013-05-25?00:55??基于SQL數據庫和C#的學生成績查詢系統\10042335\Program.cs
?????目錄???????????0??2013-06-17?16:42??基于SQL數據庫和C#的學生成績查詢系統\10042335\Properties\
?????文件????????1164??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Properties\AssemblyInfo.cs
?????文件????????2840??2013-05-24?03:14??基于SQL數據庫和C#的學生成績查詢系統\10042335\Properties\Resources.Designer.cs
............此處省略33個文件信息
- 上一篇:切割鋼材經典問題求解 c#
- 下一篇:c#獲取打印機當前打印狀態完整源碼
評論
共有 條評論