• 大小: 4.33M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-29
  • 语言: C#
  • 标签: 数据库  数据  图片  

资源简介

图片二进制读取数据库(含数据库)

资源截图

代码片段和文件信息

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


namespace photoclass
{
    class baseOperate
    {
        #region  建立数据库连接
        /// 
        /// 建立数据库连接.
        /// 

        /// 返回SqlConnection对象
        public SqlConnection getcon()
        {
           //SqlConnection conn = new SqlConnection(@“data source=.;Integrated Security=SSPI;database=RetireeMis“);
            string M_str_sqlcon = “Data Source=.;Database=ptoto;Integrated Security=SSPI;“;
           //string M_str_sqlcon = Maticsoft.DBUtility.PubConstant.ConnectionString;     
            SqlConnection myCon = new SqlConnection(M_str_sqlcon);
            return myCon;
        }
        #endregion

        #region  执行SqlCommand命令
        /// 
        /// 执行SqlCommand
        /// 

        /// SQL语句
        public int getcom(string M_str_sqlstr)
        {
            SqlConnection sqlcon = this.getcon();
            sqlcon.Open();
            SqlCommand sqlcom = new SqlCommand(M_str_sqlstr sqlcon);
            int i= sqlcom.ExecuteNonQuery();
            sqlcom.Dispose();
            sqlcon.Close();
            sqlcon.Dispose();
            return i;
        }
        #endregion
       
        #region  执行SqlCommand命令
        /// 
        /// 执行SqlCommand
        /// 

        /// SQL语句
        public string  getcom1(string M_str_sqlstr)
        {
            SqlConnection sqlcon = this.getcon();
            sqlcon.Open();
            SqlCommand sqlcom = new SqlCommand(M_str_sqlstr sqlcon);
            string str = sqlcom.ExecuteScalar().ToString();     
            sqlcom.Dispose();
            sqlcon.Close();
            sqlcon.Dispose(); 
            return str;
        }
        #endregion

        #region  创建DataSet对象
        /// 
        /// 创建一个DataSet对象
        /// 

        /// SQL语句
        /// 表名
        /// 返回DataSet对象
        public DataSet getds(string M_str_sqlstr string M_str_table)
        {
            SqlConnection sqlcon = this.getcon();
            SqlDataAdapter sqlda = new SqlDataAdapter(M_str_sqlstr sqlcon);
            DataSet myds = new DataSet();
            sqlda.Fill(myds M_str_table);
            return myds;
        }
        #endregion

        #region  创建SqlDataReader对象
        /// 
        /// 创建一个SqlDataReader对象
        /// 

        /// SQL语句
        /// 返回SqlDataReader对象
        public SqlDataReader getread(string M_str_sqlstr)
        {
            SqlConnection sqlcon = this.getcon();
            SqlCommand sqlcom = new SqlCommand(M_str_sqlstr sqlco

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-09-02 09:46  photo\
     目录           0  2020-09-02 09:46  photo\Backup\
     文件         905  2010-08-19 13:15  photo\Backup\photo.sln
     文件       14848  2010-08-24 14:11  photo\Backup\photo.v12.suo
     目录           0  2020-09-02 09:46  photo\Backup\photo\
     文件        3340  2010-08-20 17:51  photo\Backup\photo\baseOperate.cs
     文件       23186  2010-08-24 14:02  photo\Backup\photo\Form1.cs
     文件       20685  2010-08-24 14:02  photo\Backup\photo\Form1.Designer.cs
     文件        6432  2010-08-24 14:02  photo\Backup\photo\Form1.resx
     文件        4159  2010-08-20 09:44  photo\Backup\photo\photo.csproj
     文件         486  2010-08-19 13:15  photo\Backup\photo\Program.cs
     目录           0  2020-09-02 09:46  photo\Backup\photo\Properties\
     文件        1342  2010-08-19 13:15  photo\Backup\photo\Properties\AssemblyInfo.cs
     文件        3840  2010-08-19 21:58  photo\Backup\photo\Properties\Resources.Designer.cs
     文件        6927  2010-08-19 21:58  photo\Backup\photo\Properties\Resources.resx
     文件        1090  2010-08-19 13:15  photo\Backup\photo\Properties\Settings.Designer.cs
     文件         249  2010-08-19 13:15  photo\Backup\photo\Properties\Settings.settings
     目录           0  2020-09-02 09:46  photo\Backup\photo\Resources\
     文件         766  2010-08-19 21:58  photo\Backup\photo\Resources\add_1.ico
     文件         766  2010-08-19 18:23  photo\Backup\photo\Resources\del_1.ico
     文件        5426  2010-08-19 15:37  photo\Backup\photo\Resources\头像.jpg
     文件        4566  2010-08-19 15:37  photo\Backup\photo\Resources\头像女.jpg
     文件         984  2020-09-02 09:46  photo\photo.sln
     文件       14848  2010-08-24 14:11  photo\photo.suo
     文件       30720  2020-09-16 21:21  photo\photo.v12.suo
     目录           0  2020-09-02 09:46  photo\photo\
     文件        3340  2010-08-20 17:51  photo\photo\baseOperate.cs
     目录           0  2020-09-02 09:46  photo\photo\bin\
     目录           0  2020-09-02 09:46  photo\photo\bin\Debug\
     文件       35328  2020-09-02 09:46  photo\photo\bin\Debug\photo.exe
     文件       52736  2020-09-02 09:46  photo\photo\bin\Debug\photo.pdb
............此处省略36个文件信息

评论

共有 条评论