如何将图片导入sql2000

来源:百度知道 编辑:UC知道 时间:2024/06/15 22:17:05
已经建立了一个表,表中有一类型为IMAGE的列,请问如何不借助其他语言,直接将本机中的图片导入进去??

以下是自己写的完整的代码

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

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string MyFileName;
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "所有图片文件(*.BMP,*.JPEG*.GIF,*.PNG,*.TIFF,*.JPG)|*.bmp;*.jpeg;*.gif;*.jpg";
dlg.CheckFileExists = true;
if (dlg.ShowDialog() == DialogResult.OK)
{
MyFileName = dlg.FileName;
this.picture