<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FDatabase_ADO.net%2FLoad_Image</id>
		<title>Csharp/C Sharp/Database ADO.net/Load Image - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FDatabase_ADO.net%2FLoad_Image"/>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Database_ADO.net/Load_Image&amp;action=history"/>
		<updated>2026-04-13T20:17:56Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Database_ADO.net/Load_Image&amp;diff=1027&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Database_ADO.net/Load_Image&amp;diff=1027&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Database_ADO.net/Load_Image&amp;diff=1028&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Database_ADO.net/Load_Image&amp;diff=1028&amp;oldid=prev"/>
				<updated>2010-05-26T11:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Read image data from database and display that image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.IO;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
public class Form1 : System.Windows.Forms.Form {&lt;br /&gt;
   private System.Windows.Forms.Button button1;&lt;br /&gt;
   private System.Windows.Forms.TextBox textBox1;&lt;br /&gt;
   private System.Windows.Forms.PictureBox pictureBox1;&lt;br /&gt;
   private Images images;&lt;br /&gt;
   private System.ruponentModel.Container components = null;&lt;br /&gt;
   public Form1() {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      images = new Images();&lt;br /&gt;
      if (images.GetRow()) {&lt;br /&gt;
            this.textBox1.Text = images.GetFilename();&lt;br /&gt;
            this.pictureBox1.Image = (Image)images.GetImage();&lt;br /&gt;
      } else {&lt;br /&gt;
            this.textBox1.Text = &amp;quot;DONE&amp;quot;;&lt;br /&gt;
            this.pictureBox1.Image = null;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   private void InitializeComponent() {&lt;br /&gt;
      this.button1 = new System.Windows.Forms.Button();&lt;br /&gt;
      this.textBox1 = new System.Windows.Forms.TextBox();&lt;br /&gt;
      this.pictureBox1 = new System.Windows.Forms.PictureBox();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      this.button1.Location = new System.Drawing.Point(200, 8);&lt;br /&gt;
      this.button1.Name = &amp;quot;button1&amp;quot;;&lt;br /&gt;
      this.button1.TabIndex = 0;&lt;br /&gt;
      this.button1.Text = &amp;quot;Next&amp;quot;;&lt;br /&gt;
      this.button1.Click += new System.EventHandler(this.button1_Click);&lt;br /&gt;
      this.textBox1.Location = new System.Drawing.Point(24, 8);&lt;br /&gt;
      this.textBox1.Name = &amp;quot;textBox1&amp;quot;;&lt;br /&gt;
      this.textBox1.Size = new System.Drawing.Size(144, 20);&lt;br /&gt;
      this.textBox1.TabIndex = 1;&lt;br /&gt;
      this.textBox1.Text = &amp;quot;&amp;quot;;&lt;br /&gt;
      this.pictureBox1.Location = new System.Drawing.Point(8, 48);&lt;br /&gt;
      this.pictureBox1.Name = &amp;quot;pictureBox1&amp;quot;;&lt;br /&gt;
      this.pictureBox1.Size = new System.Drawing.Size(280, 208);&lt;br /&gt;
      this.pictureBox1.TabIndex = 2;&lt;br /&gt;
      this.pictureBox1.TabStop = false;&lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 272);&lt;br /&gt;
      this.Controls.Add(this.pictureBox1);&lt;br /&gt;
      this.Controls.Add(this.textBox1);&lt;br /&gt;
      this.Controls.Add(this.button1);&lt;br /&gt;
      this.Name = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Display Images&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
   }&lt;br /&gt;
   static void Main() {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
   }&lt;br /&gt;
   private void button1_Click(object sender, System.EventArgs e) {&lt;br /&gt;
      if (images.GetRow()) {&lt;br /&gt;
         this.textBox1.Text = images.GetFilename();&lt;br /&gt;
         this.pictureBox1.Image = (Image)images.GetImage();&lt;br /&gt;
      } else {&lt;br /&gt;
         this.textBox1.Text = &amp;quot;DONE&amp;quot;;&lt;br /&gt;
         this.pictureBox1.Image = null;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class Images{&lt;br /&gt;
   string imageFilename = null;&lt;br /&gt;
   byte[] imageBytes = null;&lt;br /&gt;
   SqlConnection imageConnection = null;&lt;br /&gt;
   SqlCommand imageCommand = null;&lt;br /&gt;
   SqlDataReader imageReader = null;&lt;br /&gt;
   public Images() {&lt;br /&gt;
      imageConnection = new SqlConnection(&amp;quot;server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI&amp;quot;);&lt;br /&gt;
      imageCommand = new SqlCommand(@&amp;quot;select imagefile, imagedata from imagetable&amp;quot;, imageConnection);&lt;br /&gt;
      imageConnection.Open();&lt;br /&gt;
      imageReader = imageCommand.ExecuteReader();&lt;br /&gt;
   }&lt;br /&gt;
   public Bitmap GetImage() {&lt;br /&gt;
      MemoryStream ms = new MemoryStream(imageBytes);&lt;br /&gt;
      Bitmap bmap = new Bitmap(ms);&lt;br /&gt;
      return bmap;&lt;br /&gt;
   }&lt;br /&gt;
   public string GetFilename() {&lt;br /&gt;
      return imageFilename;&lt;br /&gt;
   }&lt;br /&gt;
   public bool GetRow() {&lt;br /&gt;
      if (imageReader.Read()) {&lt;br /&gt;
        imageFilename = (string) imageReader.GetValue(0);&lt;br /&gt;
        imageBytes = (byte[]) imageReader.GetValue(1);&lt;br /&gt;
        return true;&lt;br /&gt;
      }else {&lt;br /&gt;
        return false;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   public void EndImages() {&lt;br /&gt;
      imageReader.Close();&lt;br /&gt;
      imageConnection.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>