• 大小: 26.96MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-13
  • 语言: C#
  • 标签: C#MyKTV  

资源简介

这是C#编程MyKTV的完整项目,包括前台与后台,数据库,界面美观,代码完整,有注释。歌曲资源自己加入,下载作为学习参考资料,有助于提高你的水平。

资源截图

代码片段和文件信息

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

namespace Client
{
    public class DBHelper
    {
        /// 
        /// 连接字符串
        /// 

        private static String _connectionString = “server=.;database=MyKTV;integrated security=true;“;
        public static String ConnectionString
        {
            get
            {
                return _connectionString;
            }
        }

        /// 
        /// 增删改
        /// 

        /// 
        /// 
        public static int ExecuteNonQuery(string sql)
        {
            SqlConnection conn = new SqlConnection(DBHelper.ConnectionString);
            SqlCommand cmd = new SqlCommand(sql conn);
            int result = 0;
            try
            {
                conn.Open();
                result = cmd.ExecuteNonQuery();
            }
            catch
            {
                result = -1;
                //throw;
            }
            finally
            {
                if (conn != null && conn.State != ConnectionState.Closed)
                    conn.Close();
            }
            return result;
        }

        /// 
        /// 查询标量
        /// 

        /// 
        /// 
        public static object ExecuteScalar(string sql)
        {
            SqlConnection conn = new SqlConnection(DBHelper.ConnectionString);
            SqlCommand cmd = new SqlCommand(sql conn);
            object result = 0;
            try
            {
                conn.Open();
                result = cmd.ExecuteScalar();
            }
            catch
            {
                result = -1;
                //throw;
            }
            finally
            {
                if (conn != null && conn.State != ConnectionState.Closed)
                    conn.Close();
            }
            return result;
        }

        /// 
        /// 查询结果集
        /// 

        /// 
        /// 
        public static SqlDataReader ExecuteReader(string sql)
        {
            SqlConnection conn = new SqlConnection(DBHelper.ConnectionString);
            SqlCommand cmd = new SqlCommand(sql conn);
            SqlDataReader result = null;
            try
            {
                conn.Open();
                result = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            }
            catch
            {
                //throw;
            }
            return result;
        }

        /// 
        /// 获取数据集
        /// 

        /// 
        /// 
        public static DataSet GetDataSet(string sql)
        {

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

     文件      53760  2012-08-04 01:46  成品\Client\Client\bin\Debug\AxInterop.WMPLib.dll

     文件    6641664  2013-01-07 16:04  成品\Client\Client\bin\Debug\Client.exe

     文件     284160  2013-01-07 16:04  成品\Client\Client\bin\Debug\Client.pdb

     文件      11600  2013-01-07 16:04  成品\Client\Client\bin\Debug\Client.vshost.exe

     文件        490  2010-03-17 22:39  成品\Client\Client\bin\Debug\Client.vshost.exe.manifest

     文件     331264  2012-09-29 07:02  成品\Client\Client\bin\Debug\Interop.WMPLib.dll

     文件       8278  2012-08-03 12:09  成品\Client\Client\Client.csproj

     文件       3382  2012-08-03 13:56  成品\Client\Client\DBHelper.cs

     文件       5721  2012-08-04 01:33  成品\Client\Client\FrmHasSung.cs

     文件      25570  2012-08-04 00:28  成品\Client\Client\FrmHasSung.Designer.cs

     文件     939676  2012-08-04 00:28  成品\Client\Client\FrmHasSung.resx

     文件       7755  2012-11-15 18:40  成品\Client\Client\FrmMain.cs

     文件       9350  2012-08-04 00:28  成品\Client\Client\FrmMain.Designer.cs

     文件    1072742  2012-08-04 00:28  成品\Client\Client\FrmMain.resx

     文件       6529  2012-08-04 01:33  成品\Client\Client\FrmOrdered.cs

     文件      29560  2012-08-04 00:29  成品\Client\Client\FrmOrdered.Designer.cs

     文件     936176  2012-08-04 00:29  成品\Client\Client\FrmOrdered.resx

     文件      11370  2012-08-04 01:34  成品\Client\Client\FrmOrderSongs.cs

     文件      40547  2012-08-03 15:04  成品\Client\Client\FrmOrderSongs.Designer.cs

     文件     910258  2012-08-03 15:04  成品\Client\Client\FrmOrderSongs.resx

     文件       1479  2012-08-04 01:35  成品\Client\Client\FrmOthers.cs

     文件       5111  2012-08-04 01:35  成品\Client\Client\FrmOthers.Designer.cs

     文件    1037685  2012-08-04 01:35  成品\Client\Client\FrmOthers.resx

     文件       8965  2012-08-04 16:13  成品\Client\Client\FrmSinger.cs

     文件       8841  2012-08-04 01:36  成品\Client\Client\FrmSinger.cs.bak

     文件      46759  2012-08-04 00:33  成品\Client\Client\FrmSinger.Designer.cs

     文件    1036979  2012-08-04 00:33  成品\Client\Client\FrmSinger.resx

     文件       1687  2012-10-02 15:12  成品\Client\Client\FrmSingerType.cs

     文件       9378  2012-08-04 01:38  成品\Client\Client\FrmSingerType.Designer.cs

     文件    1071255  2012-08-04 01:38  成品\Client\Client\FrmSingerType.resx

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

评论

共有 条评论

相关资源