• 大小: 16.94MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-26
  • 语言: 其他
  • 标签: 有数据库    

资源简介

学生项目豪车系统数据库源代码都要私信我免费发邮件给你

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace jiemian
{
    class DBHelper
    {
        //连接数据库
        public static string connstr = “Data Source=.;Initial Catalog=haocheDB;Integrated Security=True“;

        public static DataTable select(string proc params SqlParameter[] p)
        {
            SqlConnection con = new SqlConnection(connstr);
            SqlCommand cmd = new SqlCommand(proc con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddRange(p);
            SqlDataAdapter dr = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            dr.Fill(dt);
            return dt;
        }
        public static bool Execute(string proc params SqlParameter[] p)
        {
            SqlConnection conn = new SqlConnection(connstr);
            conn.Open();
            SqlCommand cmd = new SqlCommand(proc conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddRange(p);
            int count = cmd.ExecuteNonQuery();
            conn.Close();
            return count > 0;
        }
        //增删改
        public static bool Execute(string sql)
        {
            SqlConnection conn = new SqlConnection(connstr);
            conn.Open();
            SqlCommand cmd = new SqlCommand(sqlconn);
            int count = cmd.ExecuteNonQuery();
            conn.Close();
            return count > 0;
        }

     
        //查询
        public static DataTable select(string sql)
        {
            SqlConnection conn = new SqlConnection(connstr);
            SqlDataAdapter sda = new SqlDataAdapter(sql conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            return dt;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-26 08:26  豪车项目\
     文件     5242880  2019-01-11 12:56  豪车项目\haocheDB.mdf
     文件     2097152  2019-01-11 12:56  豪车项目\haocheDB_log.ldf
     目录           0  2019-01-09 08:31  豪车项目\豪车\
     文件         162  2018-06-06 14:31  豪车项目\豪车\~$销售管理系统需求说明书.doc
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\WindowsFormsApplication1\
     文件         187  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\App.config
     文件        1174  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Form1.Designer.cs
     文件         405  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Form1.cs
     文件         536  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Program.cs
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\
     文件        1368  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\AssemblyInfo.cs
     文件        2900  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\Resources.Designer.cs
     文件        5612  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\Resources.resx
     文件        1111  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\Settings.Designer.cs
     文件         249  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\Properties\Settings.settings
     文件        4079  2018-05-03 14:03  豪车项目\豪车\豪车登录\WindowsFormsApplication1\WindowsFormsApplication1.csproj
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\WindowsFormsApplication1\bin\
     目录           0  2019-03-26 09:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\bin\Debug\
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\
     目录           0  2019-01-09 08:31  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\
     文件        6995  2018-05-03 14:03  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2019-03-26 09:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\TempPE\
     文件           0  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2018-05-03 14:02  豪车项目\豪车\豪车登录\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     文件       12505  2018-05-03 14:03  豪车项目\豪车\豪车登录\WindowsFormsApplication1\商品信息录入.Designer.cs
     文件         514  2018-05-03 14:03  豪车项目\豪车\豪车登录\WindowsFormsApplication1\商品信息录入.cs
     文件        5817  2018-05-03 14:03  豪车项目\豪车\豪车登录\WindowsFormsApplication1\商品信息录入.resx
     目录           0  2019-01-09 10:09  豪车项目\豪车\豪车登录\jiemian\
............此处省略181个文件信息

评论

共有 条评论