• 大小: 12.73M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 数据库  文件    数据  

资源简介

以文件名存入数据库和读取,实现了将图片存入数据库 并读取出来

内部有详细的注释,为的是能够帮助新人!大家一起加油

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

using System.Data.SqlClient;
using SpeechLib;

namespace writeandreadforsqlserver
{
    public partial class Form1 : Form
    {
        //string str = “server=.;database=DENGLU;uid=ycdz;pwd=youchuang@029“;
        private string str = “server=.;database=DENGLU;Trusted_Connection=SSPI“;
        public Form1()
        {
            InitializeComponent();
        }

        public static void Read_Image(OpenFileDialog openF PictureBox MyImage)
        {
            openF.Filter = “*.jpg|*.jpg|*.bmp|*.bmp“;
            if (openF.ShowDialog() == DialogResult.OK)

            {
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     9699328  2018-12-05 21:11  DENGLU.mdf
     文件     5963776  2018-12-05 21:11  DENGLU_log.LDF
     文件       41404  2018-11-28 17:19  UpgradeLog.htm
     文件       11776  2014-03-12 21:06  bmpjpgWr.suo
     目录           0  2018-12-05 21:32  writeandreadforsqlserver\
     文件        6230  2018-12-05 20:56  writeandreadforsqlserver\Form1.Designer.cs
     文件        4705  2018-12-05 21:32  writeandreadforsqlserver\Form1.cs
     文件        6190  2018-12-03 10:48  writeandreadforsqlserver\Form1.resx
     文件        1464  2018-12-05 20:56  writeandreadforsqlserver\Program.cs
     目录           0  2018-12-05 21:21  writeandreadforsqlserver\Properties\
     文件        1398  2018-12-05 20:56  writeandreadforsqlserver\Properties\AssemblyInfo.cs
     文件        2888  2018-12-05 20:55  writeandreadforsqlserver\Properties\Resources.Designer.cs
     文件        5612  2013-05-09 22:20  writeandreadforsqlserver\Properties\Resources.resx
     文件        1124  2018-12-05 20:55  writeandreadforsqlserver\Properties\Settings.Designer.cs
     文件         249  2013-05-09 22:20  writeandreadforsqlserver\Properties\Settings.settings
     文件         176  2018-12-01 14:59  writeandreadforsqlserver\app.config
     目录           0  2018-12-05 21:21  writeandreadforsqlserver\bin\
     目录           0  2018-12-05 21:21  writeandreadforsqlserver\bin\Debug\
     目录           0  2018-12-05 21:21  writeandreadforsqlserver\bin\Debug\Picture\
     文件       76890  2018-11-30 12:39  writeandreadforsqlserver\bin\Debug\Picture\1.jpg
     文件       17920  2018-12-05 21:33  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.exe
     文件         176  2018-12-01 14:59  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.exe.config
     文件       30208  2018-12-05 21:33  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.pdb
     文件       22688  2018-12-05 21:02  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.vshost.exe
     文件         176  2018-12-01 14:59  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.vshost.exe.config
     文件         490  2015-06-04 12:48  writeandreadforsqlserver\bin\Debug\writeandreadforsqlserver.vshost.exe.manifest
     目录           0  2018-12-05 21:34  writeandreadforsqlserver\bin\Release\
     目录           0  2018-12-05 21:30  writeandreadforsqlserver\libs\
     文件      165376  2018-12-05 21:30  writeandreadforsqlserver\libs\Interop.SpeechLib.dll
     文件        4969  2018-12-05 20:56  writeandreadforsqlserver\login.Designer.cs
     文件        1642  2018-12-05 20:56  writeandreadforsqlserver\login.cs
............此处省略28个文件信息

评论

共有 条评论