• 大小: 11.01MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-13
  • 语言: 其他
  • 标签:

资源简介

界面美观 主题性界面一体化,自带数据库,操作方便简单,

资源截图

代码片段和文件信息

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

namespace Client
{
    class DBHelper
    {
        //连接字符串
        private const string strConn = “server = .;database = MyKTV;uid = sa;pwd = 123“;

        //连接对象
        private SqlConnection conn;

        //连接对象
        public SqlConnection Conn
        {
            get
            {
                if (conn == null)
                {
                    conn = new SqlConnection(strConn);
                }
                return conn;
            }
        }

        /// 
        /// 查询多个数据的方法
        /// 

        /// 
        /// 
        public SqlDataReader DataReader(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);

            try
            {
                Conn.Open();
                return cmd.ExecuteReader(CommandBehavior.CloseConnection);
            }
            catch
            {
                return null;
            }
        }

        /// 
        /// 查询单个数据的方法
        /// 

        /// 
        /// 
        public object DataScalar(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);

            try
            {
                Conn.Open();
                return cmd.ExecuteScalar();
            }
            catch
            {
                return null;
            }
            finally
            {
                Conn.Close();
            }
        }

        /// 
        /// 更新数据库的方法
        /// 

        /// 
        /// 
        public int DataChange(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);

            try
            {
                Conn.Open();
                return cmd.ExecuteNonQuery();
            }
            catch
            {
                return -1;
            }
            finally
            {
                Conn.Close();
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-03-31 12:25  MyKTV\
     目录           0  2012-03-30 22:27  MyKTV\Client\
     目录           0  2012-03-30 22:27  MyKTV\Client\Client\
     文件        8180  2011-09-22 16:06  MyKTV\Client\Client\Client.csproj
     文件         227  2011-09-19 19:18  MyKTV\Client\Client\Client.csproj.user
     文件        2341  2011-09-22 19:46  MyKTV\Client\Client\DBHelper.cs
     文件       16716  2011-09-22 19:28  MyKTV\Client\Client\FrmMain.Designer.cs
     文件        4055  2011-09-22 19:36  MyKTV\Client\Client\FrmMain.cs
     文件        6214  2011-09-22 19:28  MyKTV\Client\Client\FrmMain.resx
     文件       19291  2011-09-23 20:23  MyKTV\Client\Client\FrmOrderBySinger.Designer.cs
     文件        6430  2011-09-23 20:49  MyKTV\Client\Client\FrmOrderBySinger.cs
     文件     2577569  2011-09-23 20:23  MyKTV\Client\Client\FrmOrderBySinger.resx
     文件       16572  2011-09-22 19:02  MyKTV\Client\Client\FrmOrderBySongName.Designer.cs
     文件        2931  2011-09-23 20:50  MyKTV\Client\Client\FrmOrderBySongName.cs
     文件        6760  2011-09-22 19:02  MyKTV\Client\Client\FrmOrderBySongName.resx
     文件       12560  2011-09-23 20:23  MyKTV\Client\Client\FrmOrderBySongType.Designer.cs
     文件        1988  2011-09-23 20:49  MyKTV\Client\Client\FrmOrderBySongType.cs
     文件     1732236  2011-09-23 20:23  MyKTV\Client\Client\FrmOrderBySongType.resx
     文件       13010  2011-09-22 19:03  MyKTV\Client\Client\FrmOrderByWordCount.Designer.cs
     文件        2026  2011-09-23 20:50  MyKTV\Client\Client\FrmOrderByWordCount.cs
     文件        6213  2011-09-22 19:03  MyKTV\Client\Client\FrmOrderByWordCount.resx
     文件       11772  2011-09-22 18:13  MyKTV\Client\Client\FrmOrderedSongList.Designer.cs
     文件        3801  2011-09-23 21:08  MyKTV\Client\Client\FrmOrderedSongList.cs
     文件        6215  2011-09-22 18:13  MyKTV\Client\Client\FrmOrderedSongList.resx
     文件        3670  2011-09-22 19:20  MyKTV\Client\Client\FrmPlay.Designer.cs
     文件        2734  2011-09-23 21:16  MyKTV\Client\Client\FrmPlay.cs
     文件        6700  2011-09-22 19:20  MyKTV\Client\Client\FrmPlay.resx
     文件       14086  2011-09-22 19:03  MyKTV\Client\Client\FrmSongList.Designer.cs
     文件        4141  2011-09-23 21:06  MyKTV\Client\Client\FrmSongList.cs
     文件        6760  2011-09-22 19:03  MyKTV\Client\Client\FrmSongList.resx
     文件         886  2011-09-23 21:04  MyKTV\Client\Client\KTVUtil.cs
............此处省略173个文件信息

评论

共有 条评论