• 大小: 1.01MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-30
  • 语言: C#
  • 标签: c#  超市管理  课程设计  

资源简介

超市管理系统 c# sql 数据库设计 软件设计源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace WindowsApplication1
{
    class connectdatabase
    {//SqlConnection conn = new SqlConnection(“Server=(local);Integrated Security=SSPI;database=supermarketdb;“);
        //SqlConnection conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;Integrated Security=SSPI;database=supermarketdb;“);一般数据库连接 不同身份连接数据库
    
        private static string UserJ = ““;//标示用户访问数据库的级别  数据库连接选择
        public static string UserJB
        {
            get { return UserJ; }
            set { UserJ = value; }

        }

        SqlConnection conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;Integrated Security=SSPI;database=supermarketdb;“);
       
        public connectdatabase()
        {
           
            if (UserJB == “1“) { conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;database=supermarketdb;uid=ztf;pwd=123;“); }

            if (UserJB == “2“) { conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;database=supermarketdb;uid=saa;pwd=123;“); }
            if (UserJB == “3“) { conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;database=supermarketdb;uid=sas;pwd=123;“); }

            else { conn = new SqlConnection(“server=ZTF\\SQLEXPRESS;Integrated Security=SSPI;database=supermarketdb;“); }


            try
            {
                conn.Open();
            }
            catch (DataException e)
            {
                System.Windows.Forms.MessageBox.Show(“连接数据库失败“);
            }
        }
        public bool readdate(string SQLstr out DataTable dt)/*执行相关查询读出表集合*/
        {
            bool flag = false;
            dt = new DataTable();
            try
            {
                SqlDataAdapter sda = new SqlDataAdapter(SQLstr conn);
                sda.Fill(dt);

                flag = true;
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(“读取数据失败失败原因:“ + e.Message);
            }
            return flag;
        }






        public void cmdm(string sql)/*执行任何数据库的相关语句过程*/
        {
            SqlCommand sc = new SqlCommand(sql conn);
            sc.CommandType = CommandType.Text;

            try
            {
                sc.ExecuteNonQuery();
                System.Windows.Forms.MessageBox.Show(“执行成功“);
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(“执行失败“ + e.Message);
            }
            finally
            {
                if (conn.State == System.Data.ConnectionState.Open)
                {
                    conn.Close();
                    conn.Dispose();
                }
            }

        }

        public string rcmdm(string sql)/*执行任何数据库的相关语句调用数据返回值*/
        {
            string k = ““;
            SqlCommand sc = new SqlCommand(sql conn);
            sc.CommandType = Co

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

     文件     118784  2008-08-25 13:44  word\可视化程序设计课程设计任务及报告书.doc

     文件     417792  2008-08-25 14:04  word\数据库应用课程设计任务及报告书.doc

     文件    3145728  2008-08-25 15:05  数据库SuperMarketdb\supermarketdb.mdf

     文件    1048576  2008-08-25 15:05  数据库SuperMarketdb\supermarketdb_log.ldf

     文件     417792  2008-08-25 14:04  数据库SuperMarketdb\数据库应用课程设计任务及报告书.doc

     文件       3842  2008-07-10 02:16  WindowsApplication1\connectdatabase.cs

     文件       1713  2008-07-07 18:07  WindowsApplication1\connectdatabase1.cs

     文件       4855  2008-08-23 16:40  WindowsApplication1\CrystalReport1.cs

     文件      16384  2008-07-04 02:20  WindowsApplication1\CrystalReport1.rpt

     文件      16734  2008-07-10 03:27  WindowsApplication1\pos前台.cs

     文件      44311  2008-07-07 03:55  WindowsApplication1\pos前台.Designer.cs

     文件       8010  2008-07-07 03:55  WindowsApplication1\pos前台.resx

     文件        479  2008-08-24 14:25  WindowsApplication1\Program.cs

     文件       7603  2008-07-07 18:02  WindowsApplication1\WindowsApplication1.csproj

     文件        219  2008-07-03 18:27  WindowsApplication1\WindowsApplication1.csproj.user

     文件        926  2008-06-30 20:21  WindowsApplication1\WindowsApplication1.sln

    ..A..H.     31232  2008-08-24 14:32  WindowsApplication1\WindowsApplication1.suo

     文件      10472  2008-07-06 23:38  WindowsApplication1\商品入库.cs

     文件      18354  2008-07-06 23:37  WindowsApplication1\商品入库.Designer.cs

     文件       5814  2008-07-06 23:37  WindowsApplication1\商品入库.resx

     文件      10757  2008-07-10 01:22  WindowsApplication1\基本信息浏览.cs

     文件       8629  2008-07-10 01:22  WindowsApplication1\基本信息浏览.Designer.cs

     文件       5814  2008-07-10 01:22  WindowsApplication1\基本信息浏览.resx

     文件        649  2008-07-10 02:15  WindowsApplication1\库存门市查询.cs

     文件       2415  2008-07-04 15:56  WindowsApplication1\库存门市查询.Designer.cs

     文件       5814  2008-07-02 03:49  WindowsApplication1\库存门市查询.resx

     文件       2074  2008-07-10 01:48  WindowsApplication1\登录.cs

     文件       5779  2008-07-07 18:04  WindowsApplication1\登录.Designer.cs

     文件       5814  2008-07-03 01:34  WindowsApplication1\登录.resx

     文件      15095  2008-07-10 04:51  WindowsApplication1\订_进_退_货物单据管理.cs

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

评论

共有 条评论