資源簡介
C#+sql圖書管理系統+源碼 不是很完整 但是大家可以借鑒一下
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Data?.SqlClient;
using?System.Data;
namespace?ClassLibrary
{
????public?class?Dbconnection
????{
????????///?
????????///?SQL-server?數據庫連接
????????///?
????????///?SqlConnection?myConnection
????????public?static?SqlConnection?Dblink()
????????{
????????????string?connectionString?=?“server=(local);database?=Library;integrated?security=true“;
????????????SqlConnection?myConnection?=?new?SqlConnection(connectionString);
????????????//SqlCommand?command?=?new?SqlCommand(connectionString);
????????????return?myConnection;
????????}
????????///?
????????///?執行SQL語句
????????///?
????????///?
????????///?int?number
????????public?int?ExeInfochange(string?sql)
????????{
????????????try
????????????{
????????????????SqlConnection?myConnection?=?Dblink();
????????????????SqlCommand?myCommand?=?myConnection.CreateCommand();
????????????????myCommand.CommandText?=?sql;
????????????????myConnection.Open();
????????????????int?number?=?myCommand.ExecuteNonQuery();
????????????????myConnection.Close();
????????????????myConnection.Dispose();
????????????????return?number;
????????????}
????????????catch?(Exception)
????????????{
????????????????return?0;
????????????}
????????}
????????///?
????????///?執行?Select?語句
????????///?
????????///?
????????///?
????????public?object?ExecuteSelect(string?sql)
????????{
????????????try
????????????{
????????????????SqlConnection?myConnection?=?Dblink();
????????????????SqlCommand?myCommand?=?myConnection.CreateCommand();
????????????????myCommand.CommandText?=?sql;
????????????????myConnection.Open();
????????????????int?number?=?Convert?.ToInt32(myCommand.ExecuteScalar());
????????????????myConnection.Close();
????????????????myConnection.Dispose();
????????????????return?number;
????????????}
????????????catch?(Exception)
????????????{
????????????????return?0;
????????????}
????????}
????????///?
????????///?獲取數據集
????????///?
????????///?
????????///?DataSet?ds
????????public?DataSet?ds(string?str1)
????????{
????????????string?sql?=?str1;
????????????try
????????????{
????????????????SqlConnection?myConnection?=?Dblink();
????????????????SqlCommand?myCommand?=?myConnection.CreateCommand();
????????????????myCommand.CommandText?=?sql;
????????????????myConnection.Open();
????????????????SqlDataAdapter?myDataReader?=?new?SqlDataAdapter();
????????????????myDataReader.SelectCommand?=?myCommand;
????????????????DataSet?ds?=?new?DataSet();
????????????????myDataReader.Fill(ds);
????????????????myConnection.Close();
????????????????myConnection.Dispose();
????????????????return?ds;
????????????}
????????????catch?(Excepti
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????20480??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\bin\Debug\ClassLibrary.dll
?????文件??????19968??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\bin\Debug\ClassLibrary.pdb
?????文件????1093632??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\bin\Debug\Interop.Excel.dll
?????文件?????217088??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\bin\Debug\Interop.Microsoft.Office.Core.dll
?????文件??????57344??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\bin\Debug\Interop.VBIDE.dll
?????文件???????2972??2008-12-08?08:44??圖書管理系統(二)?1.1?(01)\ClassLibrary\ClassLibrary.csproj
?????文件???????3102??2009-01-01?20:20??圖書管理系統(二)?1.1?(01)\ClassLibrary\Dbconnection.cs
?????文件???????6937??2008-12-31?03:37??圖書管理系統(二)?1.1?(01)\ClassLibrary\Dbinfoshow.cs
?????文件????????417??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\ClassLibrary.csproj.FileList.txt
?????文件???????1257??2008-12-28?20:25??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\ClassLibrary.csproj.FileListAbsolute.txt
?????文件????????726??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\ClassLibrary.csproj.ResolveComReference.cache
?????文件??????20480??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\ClassLibrary.dll
?????文件??????19968??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\ClassLibrary.pdb
?????文件????1093632??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\Interop.Excel.dll
?????文件?????217088??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\Interop.Microsoft.Office.Core.dll
?????文件??????57344??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\Interop.VBIDE.dll
?????文件??????16384??2009-01-01?15:33??圖書管理系統(二)?1.1?(01)\ClassLibrary\obj\Debug\Refactor\ClassLibrary.dll
?????文件???????1327??2008-11-21?16:39??圖書管理系統(二)?1.1?(01)\ClassLibrary\Properties\AssemblyInfo.cs
?????文件????????513??2008-12-08?12:25??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\app.config
?????文件??????20480??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\ClassLibrary.dll
?????文件??????19968??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\ClassLibrary.pdb
?????文件????1093632??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\Interop.Excel.dll
?????文件?????217088??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\Interop.Microsoft.Office.Core.dll
?????文件??????57344??2009-01-01?20:36??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\Interop.VBIDE.dll
?????文件??????16384??2008-12-08?13:11??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\LibraryReport1.rpt
?????文件?????933888??2009-01-01?20:37??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\圖書管理系統(二).exe
?????文件????????513??2008-12-08?12:25??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\圖書管理系統(二).exe.config
?????文件?????585216??2009-01-01?20:37??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\圖書管理系統(二).pdb
?????文件???????5632??2005-12-08?14:51??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\圖書管理系統(二).vshost.exe
?????文件????????513??2008-12-08?12:25??圖書管理系統(二)?1.1?(01)\圖書管理系統(二)\bin\Debug\圖書管理系統(二).vshost.exe.config
............此處省略204個文件信息
評論
共有 條評論