关于照片的例子

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

using System.IO;

using System.Drawing.Imaging;

 

namespace picture

{

       /// <summary>

       /// Summary description for Form1.

       /// </summary>

       public class Form1 : System.Windows.Forms.Form

       {

              private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

              private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

              private System.Data.SqlClient.SqlCommand sqlInsertCommand1;

              private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;

              private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;

              private System.Data.SqlClient.SqlConnection sqlConnection1;

              private picture.DataSet1 dataSet11;

              private System.Windows.Forms.PictureBox pictureBox1;

              private System.Windows.Forms.Label label1;

              private BindingManagerBase myBind;

              private System.Windows.Forms.Button btnNext;

              private System.Windows.Forms.Button btnPre;

              /// <summary>

              /// Required designer variable.

              /// </summary>

              private System.ComponentModel.Container components = null;

 

              public Form1()

              {

                     //

                     // Required for Windows Form Designer support

                     //

                     InitializeComponent();

 

                     //

                     // TODO: Add any constructor code after InitializeComponent call

                     //

              }

 

              /// <summary>

              /// Clean up any resources being used.

              /// </summary>

              protected override void Dispose( bool disposing )

              {

                     if( disposing )

                     {

                            if (components != null)

                            {

                                   components.Dispose();

                            }

                     }

                     base.Dispose( disposing );

              }

 

              #region Windows Form Designer generated code

              /// <summary>

              /// Required method for Designer support - do not modify

              /// the contents of this method with the code editor.

              /// </summary>

              private void InitializeComponent()

              {

                     this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

                     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();

                     this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

                     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();

                     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

                     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();

                     this.dataSet11 = new picture.DataSet1();

                     this.pictureBox1 = new System.Windows.Forms.PictureBox();

                     this.label1 = new System.Windows.Forms.Label();

                     this.btnNext = new System.Windows.Forms.Button();

                     this.btnPre = new System.Windows.Forms.Button();

                     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

                     this.SuspendLayout();

                     //

                     // sqlDataAdapter1

                     //

                     this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;

                     this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;

                     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

                     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {

                                                                                                                                                                                 new System.Data.Common.DataTableMapping("Table", "虛擬工作室", new System.Data.Common.DataColumnMapping[] {

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("員工編號", "員工編號"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("身份證字號", "身份證字號"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("姓名", "姓名"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("性別", "性別"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("地址", "地址"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("郵遞區號", "郵遞區號"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("出生日期", "出生日期"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("婚姻狀況", "婚姻狀況"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("雇用日期", "雇用日期"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("起薪", "起薪"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("目前薪資", "目前薪資"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("加薪日期", "加薪日期"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("部門", "部門"),

                                                                                                                                                                                                                                                                                                                                                                        new System.Data.Common.DataColumnMapping("玉照", "玉照")})});

                     this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;

                     //

                     // sqlDeleteCommand1

                     //

                     this.sqlDeleteCommand1.CommandText = @"DELETE FROM 虛擬工作室 WHERE (員工編號 = @Original_員工編號) AND (出生日期 = @Original_出生日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (加薪日期 = @Original_加薪日期 OR @Original_加薪日期 IS NULL AND 加薪日期 IS NULL) AND (地址 = @Original_地址 OR @Original_地址 IS NULL AND 地址 IS NULL) AND (姓名 = @Original_姓名 OR @Original_姓名 IS NULL AND 姓名 IS NULL) AND (婚姻狀況 = @Original_婚姻狀況 OR @Original_婚姻狀況 IS NULL AND 婚姻狀況 IS NULL) AND (性別 = @Original_性別 OR @Original_性別 IS NULL AND 性別 IS NULL) AND (目前薪資 = @Original_目前薪資 OR @Original_目前薪資 IS NULL AND 目前薪資 IS NULL) AND (起薪 = @Original_起薪 OR @Original_起薪 IS NULL AND 起薪 IS NULL) AND (身份證字號 = @Original_身份證字號) AND (部門 = @Original_部門 OR @Original_部門 IS NULL AND 部門 IS NULL) AND (郵遞區號 = @Original_郵遞區號 OR @Original_郵遞區號 IS NULL AND 郵遞區號 IS NULL) AND (雇用日期 = @Original_雇用日期 OR @Original_雇用日期 IS NULL AND 雇用日期 IS NULL)";

                     this.sqlDeleteCommand1.Connection = this.sqlConnection1;

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_員工編號", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "員工編號", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_加薪日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "加薪日期", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_地址", System.Data.SqlDbType.NVarChar, 41, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "地址", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_婚姻狀況", System.Data.SqlDbType.NVarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "婚姻狀況", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性別", System.Data.SqlDbType.NVarChar, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性別", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_目前薪資", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "目前薪資", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_起薪", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "起薪", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_身份證字號", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "身份證字號", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_部門", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "部門", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_郵遞區號", System.Data.SqlDbType.NVarChar, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "郵遞區號", System.Data.DataRowVersion.Original, null));

                     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_雇用日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "雇用日期", System.Data.DataRowVersion.Original, null));

                     //

                     // sqlConnection1

                     //

                     this.sqlConnection1.ConnectionString = "workstation id=/"SA1 -06C 16E92791/";packet size=4096;integrated security=SSPI;data s" +

                            "ource=/"SA1 -06C 16E92791/";persist security info=False;initial catalog=北風貿易";

                     //

                     // sqlInsertCommand1

                     //

                     this.sqlInsertCommand1.CommandText = @"INSERT INTO 虛擬工作室(身份證字號, 姓名, 性別, 地址, 郵遞區號, 出生日期, 婚姻狀況, 雇用日期, 起薪, 目前薪資, 加薪日期, 部門, 玉照) VALUES (@身份證字號, @姓名, @性別, @地址, @郵遞區號, @出生日期, @婚姻狀況, @雇用日期, @起薪, @目前薪資, @加薪日期, @部門, @玉照); SELECT 員工編號, 身份證字號, 姓名, 性別, 地址, 郵遞區號, 出生日期, 婚姻狀況, 雇用日期, 起薪, 目前薪資, 加薪日期, 部門, 玉照 FROM 虛擬工作室 WHERE (員工編號 = @@IDENTITY)";

                     this.sqlInsertCommand1.Connection = this.sqlConnection1;

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@身份證字號", System.Data.SqlDbType.NVarChar, 10, "身份證字號"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.NVarChar, 10, "姓名"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性別", System.Data.SqlDbType.NVarChar, 1, "性別"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@地址", System.Data.SqlDbType.NVarChar, 41, "地址"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@郵遞區號", System.Data.SqlDbType.NVarChar, 5, "郵遞區號"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.DateTime, 8, "出生日期"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@婚姻狀況", System.Data.SqlDbType.NVarChar, 2, "婚姻狀況"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@雇用日期", System.Data.SqlDbType.DateTime, 8, "雇用日期"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@起薪", System.Data.SqlDbType.Money, 8, "起薪"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@目前薪資", System.Data.SqlDbType.Money, 8, "目前薪資"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@加薪日期", System.Data.SqlDbType.DateTime, 8, "加薪日期"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@部門", System.Data.SqlDbType.NVarChar, 10, "部門"));

                     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@玉照", System.Data.SqlDbType.VarBinary, 2147483647, "玉照"));

                     //

                     // sqlSelectCommand1

                     //

                     this.sqlSelectCommand1.CommandText = "SELECT 員工編號, 身份證字號, 姓名, 性別, 地址, 郵遞區號, 出生日期, 婚姻狀況, 雇用日期, 起薪, 目前薪資, 加薪日期, 部門, 玉照 FR" +

                            "OM 虛擬工作室";

                     this.sqlSelectCommand1.Connection = this.sqlConnection1;

                     //

                     // sqlUpdateCommand1

                     //

                     this.sqlUpdateCommand1.CommandText = @"UPDATE 虛擬工作室 SET 身份證字號 = @身份證字號, 姓名 = @姓名, 性別 = @性別, 地址 = @地址, 郵遞區號 = @郵遞區號, 出生日期 = @出生日期, 婚姻狀況 = @婚姻狀況, 雇用日期 = @雇用日期, 起薪 = @起薪, 目前薪資 = @目前薪資, 加薪日期 = @加薪日期, 部門 = @部門, 玉照 = @玉照 WHERE (員工編號 = @Original_員工編號) AND (出生日期 = @Original_出生日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (加薪日期 = @Original_加薪日期 OR @Original_加薪日期 IS NULL AND 加薪日期 IS NULL) AND (地址 = @Original_地址 OR @Original_地址 IS NULL AND 地址 IS NULL) AND (姓名 = @Original_姓名 OR @Original_姓名 IS NULL AND 姓名 IS NULL) AND (婚姻狀況 = @Original_婚姻狀況 OR @Original_婚姻狀況 IS NULL AND 婚姻狀況 IS NULL) AND (性別 = @Original_性別 OR @Original_性別 IS NULL AND 性別 IS NULL) AND (目前薪資 = @Original_目前薪資 OR @Original_目前薪資 IS NULL AND 目前薪資 IS NULL) AND (起薪 = @Original_起薪 OR @Original_起薪 IS NULL AND 起薪 IS NULL) AND (身份證字號 = @Original_身份證字號) AND (部門 = @Original_部門 OR @Original_部門 IS NULL AND 部門 IS NULL) AND (郵遞區號 = @Original_郵遞區號 OR @Original_郵遞區號 IS NULL AND 郵遞區號 IS NULL) AND (雇用日期 = @Original_雇用日期 OR @Original_雇用日期 IS NULL AND 雇用日期 IS NULL); SELECT 員工編號, 身份證字號, 姓名, 性別, 地址, 郵遞區號, 出生日期, 婚姻狀況, 雇用日期, 起薪, 目前薪資, 加薪日期, 部門, 玉照 FROM 虛擬工作室 WHERE (員工編號 = @員工編號)";

                     this.sqlUpdateCommand1.Connection = this.sqlConnection1;

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@身份證字號", System.Data.SqlDbType.NVarChar, 10, "身份證字號"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.NVarChar, 10, "姓名"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性別", System.Data.SqlDbType.NVarChar, 1, "性別"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@地址", System.Data.SqlDbType.NVarChar, 41, "地址"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@郵遞區號", System.Data.SqlDbType.NVarChar, 5, "郵遞區號"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.DateTime, 8, "出生日期"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@婚姻狀況", System.Data.SqlDbType.NVarChar, 2, "婚姻狀況"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@雇用日期", System.Data.SqlDbType.DateTime, 8, "雇用日期"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@起薪", System.Data.SqlDbType.Money, 8, "起薪"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@目前薪資", System.Data.SqlDbType.Money, 8, "目前薪資"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@加薪日期", System.Data.SqlDbType.DateTime, 8, "加薪日期"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@部門", System.Data.SqlDbType.NVarChar, 10, "部門"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@玉照", System.Data.SqlDbType.VarBinary, 2147483647, "玉照"));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_員工編號", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "員工編號", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_加薪日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "加薪日期", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_地址", System.Data.SqlDbType.NVarChar, 41, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "地址", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_婚姻狀況", System.Data.SqlDbType.NVarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "婚姻狀況", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性別", System.Data.SqlDbType.NVarChar, 1, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性別", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_目前薪資", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "目前薪資", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_起薪", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "起薪", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_身份證字號", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "身份證字號", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_部門", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "部門", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_郵遞區號", System.Data.SqlDbType.NVarChar, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "郵遞區號", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_雇用日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "雇用日期", System.Data.DataRowVersion.Original, null));

                     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@員工編號", System.Data.SqlDbType.Int, 4, "員工編號"));

                     //

                     // dataSet11

                     //

                     this.dataSet11.DataSetName = "DataSet1";

                     this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN");

                     //

                     // pictureBox1

                     //

                     this.pictureBox1.Location = new System.Drawing.Point(384, 112);

                     this.pictureBox1.Name = "pictureBox1";

                     this.pictureBox1.Size = new System.Drawing.Size(144, 160);

                     this.pictureBox1.TabIndex = 0;

                     this.pictureBox1.TabStop = false;

                     //

                     // label1

                     //

                     this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F , System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));

                     this.label1.Location = new System.Drawing.Point(424, 64);

                     this.label1.Name = "label1";

                     this.label1.Size = new System.Drawing.Size(48, 16);

                     this.label1.TabIndex = 1;

                     this.label1.Text = "玉照";

                     //

                     // btnNext

                     //

                     this.btnNext.Location = new System.Drawing.Point(464, 336);

                     this.btnNext.Name = "btnNext";

                     this.btnNext.Size = new System.Drawing.Size(96, 32);

                     this.btnNext.TabIndex = 2;

                     this.btnNext.Text = "下一个";

                     this.btnNext.Click += new System.EventHandler(this.btnNext_Click);

                     //

                     // btnPre

                     //

                     this.btnPre.Location = new System.Drawing.Point(320, 336);

                     this.btnPre.Name = "btnPre";

                     this.btnPre.Size = new System.Drawing.Size(96, 32);

                     this.btnPre.TabIndex = 3;

                     this.btnPre.Text = "上一个";

                     this.btnPre.Click += new System.EventHandler(this.btnPre_Click);

                     //

                     // Form1

                     //

                     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

                     this.ClientSize = new System.Drawing.Size(656, 406);

                     this.Controls.Add(this.btnPre);

                     this.Controls.Add(this.btnNext);

                     this.Controls.Add(this.label1);

                     this.Controls.Add(this.pictureBox1);

                     this.Name = "Form1";

                     this.Text = "Form1";

                     this.Load += new System.EventHandler(this.Form1_Load);

                     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

                     this.ResumeLayout(false);

 

              }

              #endregion

 

              /// <summary>

              /// The main entry point for the application.

              /// </summary>

              [STAThread]

              static void Main ()

              {

                     Application.Run(new Form1());

              }

 

              private void Form1_Load(object sender, System.EventArgs e)

              {

                     this.sqlDataAdapter1.Fill(this.dataSet11);

                     //myBind=this.BindingContext[this.dataSet11,"虛擬工作室"];

                    

                     /*byte[] bytBLOBData;

                     bytBLOBData=(byte[])dt.Rows[0]["玉照"];

                     MemoryStream stmBLOBData;

                     stmBLOBData=new MemoryStream(bytBLOBData);

                     this.pictureBox1.Image=Image.FromStream(stmBLOBData);*/

                     myBind=this.BindingContext[this.dataSet11,"虛擬工作室"];

                     this.myBind.PositionChanged+=new EventHandler(myBind_PositionChanged);

                     LoadPicture(this.myBind.Position);

                    

              }

 

              private void btnNext_Click(object sender, System.EventArgs e)

              {

                     this.myBind.Position++;

              }

 

              private void LoadPicture(int nRowPosition)

              {

                     DataTable dt=this.dataSet11.虛擬工作室;

                     byte[] bytBLOBData;

                     bytBLOBData=(byte[])dt.Rows[nRowPosition]["玉照"];

                     MemoryStream stmBLOBData;

                     stmBLOBData=new MemoryStream(bytBLOBData);

                     this.pictureBox1.Image=Image.FromStream(stmBLOBData);

              }

 

              private void  myBind_PositionChanged(object sender,EventArgs e)

              {

                     this.LoadPicture(this.myBind.Position);

              }

 

              private void btnPre_Click(object sender, System.EventArgs e)

              {

                     this.myBind.Position--;

              }

 

       }

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值