-
大小: 2.28MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-10-13
- 語言: C#
- 標(biāo)簽:
資源簡介
c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)c#學(xué)生成績管理系統(tǒng)

代碼片段和文件信息
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.OleDb;
namespace?student
{
????class?database
????{
????????public?OleDbConnection?Con?Con1;????????????????????//sql數(shù)據(jù)連接組件實(shí)例化
????????public?OleDbCommand?command?=?new?OleDbCommand();????//初始化一個(gè)SQL命令對象
????????public?database()?????????????????????????????????//類初始化,初始化數(shù)據(jù)連接
????????{
????????????string?path?=?@“Provider=Microsoft.Jet.OLEDB.4.0;Data?Source=studentSystem.mdb“;
????????????Con?=?new?OleDbConnection(path);
????????}
????????public?OleDbDataReader?GetReader(string?search)
????????{
????????????OleDbDataReader?Reader;
????????????if?(Con.State?!=?ConnectionState.Open)
????????????????Con.Open();
????????????OleDbCommand?Com?=?new?OleDbCommand(search?Con);
????????????Reader?=?Com.ExecuteReader();
????????????return?Reader;
????????}
????????//?輸入查詢字符串,返回dataset
????????public?DataSet?getData(string?sql)
????????{
????????????command.Connection?=?Con;????????????//配置command對象
????????????command.CommandText?=?sql;???????????//賦予要執(zhí)行的語句
????????????DataSet?dt?=?new?DataSet();??????????//初始化一個(gè)數(shù)據(jù)返回集合
????????????OleDbDataAdapter?da?=?new?OleDbDataAdapter(command);
????????????Con.Open();??????????????????????????//打開連接
????????????da.Fill(dt);?????????????????????//執(zhí)行語句
????????????command.Connection.Close();??????????//關(guān)閉連接
????????????return?dt;
????????}
????????//輸入存儲過程名稱,執(zhí)行查詢存儲過程
????????public?DataSet?getDataSet(string?produreName)
????????{
????????????command.Connection?=?Con;????????????//賦予連接對象
????????????//執(zhí)行的類型為存儲過程
????????????command.CommandType?=?CommandType.StoredProcedure;
????????????command.CommandText?=?produreName;???//賦予執(zhí)行的存儲過程名字
????????????DataSet?dt?=?new?DataSet();
????????????OleDbDataAdapter?da?=?new?OleDbDataAdapter(command);
????????????Con.Open();??????????????????????????//打開連接
????????????da.Fill(dt);?????????????????????//填充數(shù)據(jù)
????????????command.Connection.Close();
????????????return?dt;???????????????????????????//返回?cái)?shù)據(jù)集
????????}
????????//?執(zhí)行非查詢SQL語句
????????public?int?ExecuteSql(string?sql)
????????{
????????????if?(Con.State?!=?ConnectionState.Open)
????????????????Con.Open();??????????????????????//如果數(shù)據(jù)連接關(guān)閉,則打開
????????????OleDbCommand?Com?=?new?OleDbCommand(sql?Con);
????????????Com.ExecuteNonQuery();???????????????//執(zhí)行非查詢SQL語句
????????????Con.Close();
????????????return?1;
????????}
????????public?int?Execute(string?sql)
????????{
????????????if?(Con.State?!=?ConnectionState.Open)
????????????????Con.Open();??????????????????????//如果數(shù)據(jù)連接關(guān)閉,則打開
????????????OleDbCommand?Com?=?new?OleDbCommand(sql?Con);
????????????Com.ExecuteNonQuery();???????????????//執(zhí)行非查詢SQL語句
????????????return?1;
????????}
????????//?執(zhí)行非查詢數(shù)據(jù)庫操作,是否關(guān)閉數(shù)據(jù)庫連接??可以選擇
????????public?void?ExecuteSql(string?sql?bool?closeConnection)
????????{
????????????if?(C
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????141824??2008-12-11?18:27??新建文件夾?(2)\200631000723吳琦斌\200631000723吳琦斌.doc
?????文件????????409??2007-11-30?16:40??新建文件夾?(2)\200631000723吳琦斌\student\student\app.config
?????文件????1700864??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.exe
?????文件????????409??2007-11-30?16:40??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.exe.config
?????文件?????208384??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.pdb
?????文件??????14328??2009-07-21?10:51??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.vshost.exe
?????文件????????409??2007-11-30?16:40??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.vshost.exe.config
?????文件????????490??2007-07-21?01:33??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\student.vshost.exe.manifest
?????文件????1282048??2009-07-21?10:51??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug\studentSystem.mdb
?????文件??????68057??2007-12-05?23:36??新建文件夾?(2)\200631000723吳琦斌\student\student\bin\Debug.rar
?????文件???????7280??2007-12-12?21:15??新建文件夾?(2)\200631000723吳琦斌\student\student\databa
?????文件??????25729??2009-06-27?15:40??新建文件夾?(2)\200631000723吳琦斌\student\student\ManagerForm.cs
?????文件??????49732??2009-06-27?15:40??新建文件夾?(2)\200631000723吳琦斌\student\student\ManagerForm.Designer.cs
?????文件????2417104??2009-06-27?15:40??新建文件夾?(2)\200631000723吳琦斌\student\student\ManagerForm.resx
?????文件??????36711??2007-12-12?21:11??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\ResolveAssemblyReference.cache
?????文件???????2245??2009-07-21?10:51??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.csproj.FileListAbsolute.txt
?????文件????????917??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.csproj.GenerateResource.Cache
?????文件????1700864??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.exe
?????文件????1607929??2009-06-27?15:40??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.ManagerForm.resources
?????文件?????208384??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.pdb
?????文件????????180??2008-12-11?17:07??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.Properties.Resources.resources
?????文件????????180??2009-06-29?15:20??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\student.StudentForm.resources
?????文件???????5120??2008-12-11?17:07??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件??????61440??2008-12-11?17:07??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\Debug\TempPE\studentSystemDataSet.Designer.cs.dll
?????文件????????345??2007-12-12?23:18??新建文件夾?(2)\200631000723吳琦斌\student\student\obj\student.csproj.FileList.txt
?????文件????????472??2007-12-02?12:22??新建文件夾?(2)\200631000723吳琦斌\student\student\Program.cs
?????文件???????1168??2007-11-30?16:22??新建文件夾?(2)\200631000723吳琦斌\student\student\Properties\AssemblyInfo.cs
?????文件???????2838??2008-12-11?17:06??新建文件夾?(2)\200631000723吳琦斌\student\student\Properties\Resources.Designer.cs
?????文件???????5612??2007-11-30?16:22??新建文件夾?(2)\200631000723吳琦斌\student\student\Properties\Resources.resx
?????文件???????1713??2008-12-11?17:06??新建文件夾?(2)\200631000723吳琦斌\student\student\Properties\Settings.Designer.cs
............此處省略34個(gè)文件信息
評論
共有 條評論