• 大小: 8.14MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-03
  • 语言: C#
  • 标签: C#+SQl  

资源简介

课堂作业,有C#源代码,有SQL源文件。内有图片,

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;

namespace StudentScore
{
    class DataAccess
    {
        private string strDSN;
        OleDbConnection oledbCon;
        

        public void dataCon()
        {
            strDSN = “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=“ + Application.StartupPath.ToString() + “\\Student.mdb“;
            oledbCon = new OleDbConnection(strDSN );
        
        }
        public DataSet getDataset(string sql)
        {
            DataSet ds = new DataSet();
            oledbCon.Open();
            try
            {
                OleDbCommand oledbCom = new OleDbCommand(sqloledbCon );
                OleDbDataAdapter oledbDa = new OleDbDataAdapter(oledbCom);
                oledbDa.Fill (ds);
                return ds;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            finally
            {
                oledbCon.Close();
            }
        }
        public bool sqlExec(string sql)
        {
            try { oledbCon.Open(); }
            catch
            {
                MessageBox.Show(“数据库未连接“);
            }
            try
            {
                OleDbCommand oledbCom = new OleDbCommand(sql oledbCon);
                oledbCom.ExecuteNonQuery ();
                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message “提示“);
                return false;
            }
            finally
            { oledbCon.Close(); }
        }
        public OleDbDataReader getDataReader(string sql)
        {
            
            oledbCon.Open();
            try
            {
              
               
                OleDbCommand oledbCom = new OleDbCommand(sql oledbCon);
                
                OleDbDataReader oledbDr = oledbCom.ExecuteReader();
                return oledbDr;
                
            
            }
           catch (Exception ex)
            {
                throw new Exception(ex.ToString());
           }
           finally
            {
               
                oledbCon.Close();
               
               
           }
       }
        
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3995  2010-05-31 21:32  StudentScore\StudentScore\bin\Debug\drawer.png

     文件     365398  2010-12-03 16:51  StudentScore\StudentScore\bin\Debug\frmmain.jpg

     文件      36141  2010-12-03 14:13  StudentScore\StudentScore\bin\Debug\longin.jpg

     文件     132713  2010-12-03 14:54  StudentScore\StudentScore\bin\Debug\longin2.jpg

     文件      12181  2010-12-03 17:03  StudentScore\StudentScore\bin\Debug\naniu.jpg

     文件       4421  2010-05-30 17:08  StudentScore\StudentScore\bin\Debug\search.png

     文件     270336  2010-12-23 11:22  StudentScore\StudentScore\bin\Debug\student.mdb

     文件    2170880  2010-12-23 11:41  StudentScore\StudentScore\bin\Debug\StudentScore.exe

     文件     171520  2010-12-23 11:41  StudentScore\StudentScore\bin\Debug\StudentScore.pdb

     文件       5632  2005-12-08 14:51  StudentScore\StudentScore\bin\Debug\StudentScore.vshost.exe

     文件    1048576  2010-12-02 11:42  StudentScore\StudentScore\bin\Debug\student_Data.MDF

     文件    1048576  2010-12-02 11:42  StudentScore\StudentScore\bin\Debug\student_Log.LDF

     文件    1264124  2009-07-28 22:14  StudentScore\StudentScore\bin\Debug\Summer-Leaves.jpg

    ..A.SH.     23552  2010-12-08 15:06  StudentScore\StudentScore\bin\Debug\Thumbs.db

     文件       3974  2010-05-30 17:02  StudentScore\StudentScore\bin\Debug\user.png

     文件      67371  2010-12-27 16:19  StudentScore\StudentScore\bin\Debug\主界面.jpg

     文件      60898  2010-12-27 14:55  StudentScore\StudentScore\bin\Debug\界面.jpg

     文件     160270  2010-12-27 14:42  StudentScore\StudentScore\bin\Debug\登录界面.jpg

     文件      37097  2010-12-27 14:46  StudentScore\StudentScore\bin\Debug\登录界面1.jpg

     文件       2431  2010-12-08 16:27  StudentScore\StudentScore\DataAccess.cs

     文件       3737  2010-12-02 07:57  StudentScore\StudentScore\Form1.cs

     文件       6490  2010-11-26 17:13  StudentScore\StudentScore\Form1.Designer.cs

     文件       5814  2010-11-26 17:13  StudentScore\StudentScore\Form1.resx

     文件       1702  2010-12-23 11:12  StudentScore\StudentScore\frmAbout.cs

     文件       5797  2010-12-23 11:04  StudentScore\StudentScore\frmAbout.Designer.cs

     文件       5814  2010-12-23 11:04  StudentScore\StudentScore\frmAbout.resx

     文件       2676  2010-12-23 09:48  StudentScore\StudentScore\frmAddCourse.cs

     文件       6440  2010-12-23 09:48  StudentScore\StudentScore\frmAddCourse.Designer.cs

     文件       5814  2010-12-23 09:48  StudentScore\StudentScore\frmAddCourse.resx

     文件       4587  2010-12-23 09:48  StudentScore\StudentScore\frmAddScore.cs

............此处省略82个文件信息

评论

共有 条评论