亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? startform.cs

?? Adding and making operations LOB data in a database with C#
?? CS
字號:
/**********************************************************************************************
@author  Chandar
@version 1.0
Development Environment        :  Visual C#.Net Beta2
Name of the File               :  StartForm.cs
Creation/Modification History  :
                                  02-AUG-2001     Created

Sample Overview
---------------
 This sample uses ADO functionality with OraOLEDB to communicate to database.
 The sample demonstrates the feature of Oracle OLEDB provider for Oracle to
 pass LOB parameters to and from a database stored procedure. It also demonstrates
 that Oracle provider for OLEDB bypasses PL/SQL limitation of parameter size greater
 than 32K to a database stored procedure.The image passed to and from the stored procedure 
 could be of size greater than 32K.

 The property 'SPPrmsLOB' is to be set to true when LOB parameter is used in stored procedure.
 The sample shows how to set this property for the command object
  
 When this application is run, a dialog box with products loaded from "Product_Information"
 table appears. When a product is selected from the list its image is retrieved from
 database using stored procedure and displayed in "Existing Image " picture box.
 
 In case the product image needs to be changed, the user can select an image by clicking
 the "Browse" button, the selected  image from the common file dialog is displayed in the 
 "New Image" picture box. To update the new image to the database "Update" button can be 
 clicked. The selected image is converted to binary form before insertion and a 
 database stored procedure "setProductImage" is called, to which the selected image is 
 passed as LOB parameter. The image passed to  the stored procedure could be of
 size greater than 32K also. This bypasses the PL/SQL limitation of passing parameters
 greater than 32K.
 
 Note :The maximum size of image(LOB) that can be passed as  OUT parameter to stored 
       procedure with OraOLEDB is 64K. Images greater than this size may not be
	   retrieved properly from database.
*********************************************************************************************
*/

//include standard namespaces used by the sample
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

namespace LOBSample
{
    //This class is used for adding the product names and ids retrieved from
	//database into the list box.
	//The object of this class is added to list box for every product .The 'display' string 
	//is shown in the listbox and 'data' string is used when list box item is selected
	public class ComboData
	{
		public ComboData(string display,string data)
		{
			this.display=display; 
			this.data=data;
		}
		public override string ToString() 
		{
			return display;
		}
		
		public string display;    //variable for name
		public string data;       //variable for id
	}


	/// <summary>
	/// Summary description for StartForm.
	/// </summary>
	public class StartForm : System.Windows.Forms.Form
	{
		//Declaration of dialog box components
		private System.Windows.Forms.Label label1;
		public System.Windows.Forms.ComboBox comboProduct;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Button cmdBrowse;
		private System.Windows.Forms.Button cmdUpdate;
		private System.Windows.Forms.Button cmdCancel;
		private System.Windows.Forms.PictureBox pictureNew;
		private System.Windows.Forms.PictureBox pictureExisting;
		public string m_newPicture;
        
		//Define bitmab objects for shown the images in picture box
		public System.Drawing.Bitmap myImage;  
		public System.Drawing.Bitmap newImage;

		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public StartForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
             m_newPicture="";
			
		}

		/// <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.cmdUpdate = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.cmdCancel = new System.Windows.Forms.Button();
			this.pictureExisting = new System.Windows.Forms.PictureBox();
			this.cmdBrowse = new System.Windows.Forms.Button();
			this.comboProduct = new System.Windows.Forms.ComboBox();
			this.pictureNew = new System.Windows.Forms.PictureBox();
			this.SuspendLayout();
			// 
			// cmdUpdate
			// 
			this.cmdUpdate.Location = new System.Drawing.Point(248, 424);
			this.cmdUpdate.Name = "cmdUpdate";
			this.cmdUpdate.Size = new System.Drawing.Size(80, 32);
			this.cmdUpdate.TabIndex = 6;
			this.cmdUpdate.Text = "Update";
			this.cmdUpdate.Click += new System.EventHandler(this.cmdUpdate_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(96, 24);
			this.label1.TabIndex = 0;
			this.label1.Text = "Select Product";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(24, 80);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(96, 24);
			this.label2.TabIndex = 2;
			this.label2.Text = "Existing Image";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(24, 240);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(96, 24);
			this.label3.TabIndex = 3;
			this.label3.Text = "New Image";
			// 
			// cmdCancel
			// 
			this.cmdCancel.Location = new System.Drawing.Point(360, 424);
			this.cmdCancel.Name = "cmdCancel";
			this.cmdCancel.Size = new System.Drawing.Size(80, 32);
			this.cmdCancel.TabIndex = 7;
			this.cmdCancel.Text = "Cancel";
			this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
			// 
			// pictureExisting
			// 
			this.pictureExisting.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pictureExisting.Location = new System.Drawing.Point(168, 80);
			this.pictureExisting.Name = "pictureExisting";
			this.pictureExisting.Size = new System.Drawing.Size(176, 144);
			this.pictureExisting.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.pictureExisting.TabIndex = 4;
			this.pictureExisting.TabStop = false;
			// 
			// cmdBrowse
			// 
			this.cmdBrowse.Location = new System.Drawing.Point(360, 360);
			this.cmdBrowse.Name = "cmdBrowse";
			this.cmdBrowse.Size = new System.Drawing.Size(80, 32);
			this.cmdBrowse.TabIndex = 5;
			this.cmdBrowse.Text = "Browse...";
			this.cmdBrowse.Click += new System.EventHandler(this.cmdBrowse_Click);
			// 
			// comboProduct
			// 
			this.comboProduct.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.comboProduct.DropDownWidth = 176;
			this.comboProduct.Location = new System.Drawing.Point(168, 24);
			this.comboProduct.Name = "comboProduct";
			this.comboProduct.Size = new System.Drawing.Size(176, 24);
			this.comboProduct.TabIndex = 1;
			this.comboProduct.SelectedIndexChanged += new System.EventHandler(this.comboProduct_SelectedIndexChanged);
			// 
			// pictureNew
			// 
			this.pictureNew.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pictureNew.Location = new System.Drawing.Point(168, 248);
			this.pictureNew.Name = "pictureNew";
			this.pictureNew.Size = new System.Drawing.Size(176, 144);
			this.pictureNew.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.pictureNew.TabIndex = 4;
			this.pictureNew.TabStop = false;
			// 
			// StartForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
			this.ClientSize = new System.Drawing.Size(456, 469);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.pictureExisting,
																		  this.cmdCancel,
																		  this.cmdUpdate,
																		  this.cmdBrowse,
																		  this.pictureNew,
																		  this.label3,
																		  this.label2,
																		  this.comboProduct,
																		  this.label1});
			this.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Name = "StartForm";
			this.Text = "Product Image";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// Here product names are retrieved from database and shown in listbox
		/// </summary>
		[STAThread]
		static void Main() 
		{   //Create an instance of StartForm
			StartForm imgDlg= new StartForm();

			//Object for handling database functions
			OraLOB dbObj= new OraLOB();    

			//Open connection to database
			bool check = dbObj.ConnectDatabase();

			if (check==true)     //if connected
			{
				//Get the product names from database into the listbox
				bool retval = dbObj.getProductNames(imgDlg);
				if (retval==true)
				{
					//close database connection
					dbObj.CloseDatabase();
				
					//Run the application and show the startup form
					Application.Run(imgDlg);
				}
			}
			else
			{   System.Windows.Forms.MessageBox.Show("Cannot Connect to database");
				Application.Exit();
			}
       
		}
		
        /**************************************************************************
		 This function is called when list box selection is changed. It gets the id
		 of selected product, retrieves the image for it from database and shows it
		 in the picture box
		**************************************************************************/ 
		private void comboProduct_SelectedIndexChanged(object sender, System.EventArgs e)
		{   
			//Get the id of selected product .It returns the object of ComboData class
			//whose data variable returns the product id.
			string productid=((ComboData)comboProduct.SelectedItem).data;

			OraLOB dbObj= new OraLOB();    //Object for handling database functions

			//Make a connection to database
			bool retval = dbObj.ConnectDatabase();

			if (retval==true)
			{   
				//set the image in picture boxes to null
				pictureExisting.Image=null;
				pictureNew.Image=null;

				//Release the bitmap used for existing image picture box
				if(myImage!=null)
                   myImage.Dispose();

				//Relase the bitmap used for new image picture box
				if(newImage!=null)
					newImage.Dispose();

				//Call the function to get image from database
				bool check = dbObj.GetProductImage(productid);
			    dbObj.CloseDatabase();
				if (check==true)  //If image was retrieved successfully
            	{  
					//Show the image written in temporary file in picture box
					 myImage=new System.Drawing.Bitmap(Application.StartupPath+"/tempimage.gif");;
					pictureExisting.Image=(Image)myImage;
				}
				
			}
			else
                    System.Windows.Forms.MessageBox.Show("Cannot Connect to database");
			
		}
        
		/********************************************************************
		 * This function is called on click event of 'Browse' button. It opens
		 * up a file dialog box . When a particular image file is selected,
		 * the image is shown in picture box for new image
		 * ******************************************************************/
		private void cmdBrowse_Click(object sender, System.EventArgs e)
		{
			
            //Create an instance of openfile dialog
			System.Windows.Forms.OpenFileDialog fileDlg=new System.Windows.Forms.OpenFileDialog();
			
			//filter the types of files shown to image files
			fileDlg.Filter = "Image File (*.jpg;*.bmp;*.gif)|*.jpg;*.bmp;*.gif";

			fileDlg.RestoreDirectory = true ;
 
			//Show the dialog box
			if(fileDlg.ShowDialog()== DialogResult.OK)
			{
				//Get the name of selected file into a variable
				m_newPicture=fileDlg.FileName;	

				//Create a bitmap for selected image
		        newImage= new System.Drawing.Bitmap(m_newPicture);

				//Show the bitmap in picture box
               pictureNew.Image=(Image)newImage;
           	}
			
			fileDlg=null;
			
		}

		/************************************************************************
		 * This function is called when update button is clicked. It gets the 
		 * selected product and new image for it and updates it to the database.
		 * ***********************************************************************/
		private void cmdUpdate_Click(object sender, System.EventArgs e)
		{
			string productid="";
			
			//Check if user has selected product and a new image for it
			if((comboProduct.SelectedIndex==-1)||m_newPicture.Equals(""))
				System.Windows.Forms.MessageBox.Show("Select Product and New Image");
			else
			{ 
				//Get the product id of selected product. Selected item is returned
				//as object of ComboData class whose data variable contains the 
				//product id.
				productid=((ComboData)comboProduct.SelectedItem).data;
				OraLOB dbObj= new OraLOB();  //Object to handle database function

				//Connect to the database
				bool check = dbObj.ConnectDatabase();
				
                if (check==true)  //if connected
				{   
					//Call the database procedure to update the product image
					bool retval= dbObj.updateProductImage(productid,m_newPicture);
					
					if(retval==true)  //if image was updated
						System.Windows.Forms.MessageBox.Show("Product Image Updated successfully");
					else
						System.Windows.Forms.MessageBox.Show("Image cannot be updated");

					dbObj.CloseDatabase();
				}
				else
					System.Windows.Forms.MessageBox.Show("Cannot Connect to database");
			}
		}

        /*************************************************************
		 * This function is called when cancel button is clicked. It 
		 * cleans up the resources used by application and exits
		 * *********************************************************/ 
		private void cmdCancel_Click(object sender, System.EventArgs e)
		{   
			//if bitmap objects are not null , dispose them
			if(myImage!=null)
				myImage.Dispose();
			if(newImage!=null)
				newImage.Dispose();
			
			//Delete the temporary file created by the application
			System.IO.File.Delete(System.Windows.Forms.Application.StartupPath +"/tempimage.gif"); 
			
			//Close the form and exit
			this.Close();
			Application.Exit();
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品盗摄一区二区三区| 国产电影一区在线| 欧美日韩视频不卡| 丝袜亚洲另类欧美| 91麻豆精品国产| 久久97超碰色| 国产视频911| 成人免费三级在线| 亚洲欧美自拍偷拍色图| 色婷婷综合久久久中文字幕| 亚洲成人一区在线| 欧美不卡视频一区| 成人成人成人在线视频| 一区二区在线观看视频| 欧美精品免费视频| 国产精品夜夜爽| 亚洲欧洲日产国产综合网| 在线免费观看不卡av| 日韩精品91亚洲二区在线观看| 日韩欧美国产三级电影视频| 成人理论电影网| 亚洲小少妇裸体bbw| 日韩女优毛片在线| 一本色道a无线码一区v| 秋霞影院一区二区| 中文字幕av一区 二区| 色综合久久88色综合天天6 | 欧亚洲嫩模精品一区三区| 亚洲成人三级小说| 国产欧美精品一区二区色综合朱莉| 91在线看国产| 久久成人18免费观看| 亚洲三级电影全部在线观看高清| 欧美精品第一页| 波多野结衣精品在线| 久久精品国产久精国产爱| 亚洲免费资源在线播放| 精品福利在线导航| 欧美综合久久久| 国产精品99久久久久久宅男| 亚洲国产精品影院| 国产精品久久久久aaaa| 日韩欧美亚洲另类制服综合在线| 99久久精品国产导航| 久久国产精品免费| 亚洲va欧美va国产va天堂影院| 亚洲国产精品成人综合色在线婷婷| 欧美日韩国产一区| 99国产精品久久久久久久久久| 另类中文字幕网| 亚洲综合色自拍一区| 国产蜜臀av在线一区二区三区| 欧美一区二区视频网站| 欧美午夜在线一二页| 91在线视频播放地址| 国产成人综合在线观看| 裸体在线国模精品偷拍| 亚洲国产精品自拍| 亚洲综合男人的天堂| 中文字幕一区二区三区四区| 久久久亚洲精品石原莉奈| 日韩一区二区三区观看| 欧美精三区欧美精三区| 欧美性大战久久| 色综合久久久久综合体| 成人性生交大片免费看在线播放| 国内精品视频666| 日韩经典中文字幕一区| 婷婷综合另类小说色区| 亚洲综合久久av| 亚洲国产欧美一区二区三区丁香婷| 国产精品免费丝袜| 久久精品视频在线看| 日韩美女视频在线| 日韩三级视频在线看| 日韩欧美在线123| 日韩欧美你懂的| 精品久久久久久久久久久久久久久久久| 日韩电影一区二区三区四区| 亚洲v精品v日韩v欧美v专区 | 国产欧美一区二区三区在线看蜜臀 | 亚洲欧美成人一区二区三区| 国产精品久久一级| 中文字幕精品一区| 中文字幕一区二区在线播放| 亚洲日本乱码在线观看| 亚洲裸体在线观看| 一区二区三区高清| 亚洲精品免费在线| 天堂蜜桃91精品| 日本不卡的三区四区五区| 精品亚洲porn| 高清久久久久久| 91碰在线视频| 91精品国产欧美日韩| 欧美mv和日韩mv的网站| 国产日韩欧美综合一区| 亚洲色图视频免费播放| 午夜视频在线观看一区| 久久99热国产| 91老师国产黑色丝袜在线| 欧美亚一区二区| 欧美sm美女调教| 国产精品看片你懂得| 夜夜嗨av一区二区三区| 美女爽到高潮91| 成a人片亚洲日本久久| 欧美在线观看一区| 精品国产一区二区三区不卡| 欧美国产日产图区| 亚洲 欧美综合在线网络| 激情文学综合网| 99国产精品99久久久久久| 欧美久久久久中文字幕| 国产日韩精品久久久| 亚洲一区二区三区四区五区中文| 欧美老女人第四色| 欧美色图12p| 久久久噜噜噜久久人人看| 亚洲欧美偷拍三级| 久久99久久久欧美国产| 91国内精品野花午夜精品| 欧美va亚洲va国产综合| 亚洲综合在线观看视频| 国产精品99久久久久久宅男| 欧美视频精品在线观看| 国产亚洲欧洲997久久综合| 在线不卡一区二区| 精品国产sm最大网站免费看| 亚洲日本丝袜连裤袜办公室| 精品亚洲成a人| 欧美色欧美亚洲另类二区| 国产片一区二区| 日韩av电影一区| 在线欧美一区二区| 中文字幕av一区二区三区免费看| 日本伊人色综合网| 欧美性猛交xxxx黑人交| 国产精品情趣视频| 精品制服美女久久| 欧美日韩夫妻久久| 亚洲靠逼com| 丰满白嫩尤物一区二区| 日韩视频国产视频| 日韩影院精彩在线| 精品视频在线视频| 一区二区成人在线| 99久久久国产精品| 国产精品人妖ts系列视频| 免费在线观看日韩欧美| 欧美日韩黄视频| 一区二区在线电影| 91亚洲精品一区二区乱码| 久久精品视频免费| 国产在线国偷精品产拍免费yy| 欧美日韩精品久久久| 亚洲综合一二区| 在线免费观看日韩欧美| 亚洲免费三区一区二区| 99re热这里只有精品免费视频| 中文字幕第一区第二区| 国产丶欧美丶日本不卡视频| 久久先锋影音av| 国产美女主播视频一区| 久久青草欧美一区二区三区| 国内外精品视频| 久久精品在这里| 国产成人在线观看免费网站| 久久综合九色欧美综合狠狠| 国内精品久久久久影院色| 337p日本欧洲亚洲大胆精品| 国产精品99久久久| 欧美国产综合一区二区| 成人黄色一级视频| 中文字幕一区二区三区不卡在线| jvid福利写真一区二区三区| 国产精品久久久久aaaa樱花| 91麻豆精东视频| 亚洲午夜在线观看视频在线| 欧美顶级少妇做爰| 六月丁香婷婷色狠狠久久| 久久这里只有精品首页| 成人福利视频在线看| 亚洲精品菠萝久久久久久久| 欧美人xxxx| 久热成人在线视频| 国产精品日产欧美久久久久| 色老综合老女人久久久| 午夜精品久久久久影视| 日韩欧美视频在线| 成人国产精品免费观看视频| 悠悠色在线精品| 日韩欧美国产精品| 岛国精品在线播放| 亚洲精品日日夜夜| 日韩一区二区免费视频| 国产成人av在线影院| 怡红院av一区二区三区| 日韩午夜在线播放| 成人禁用看黄a在线|