Store an Image(OLE Object) into Access Data Base
Store an Image(OLE Object) into Access Data Base
C# Winform application Store an Image into Access Data Base
ÓÃÒÔÏ·½·¨
/// 2010-02-26 Forever
private void SaveImageInDataBase()
{
OleDbConnection conn = null;
try
{
string strDBFile = Environment.CurrentDirectory + @"\Test.mdb";
string connstr = "Jet OLEDB:Database Password=;Data Source='" + strDBFile + "';Password=;Provider='Microsoft.Jet.OLEDB.4.0'";
conn = new OleDbConnection(connstr);
OleDbCommand cmd;
String strimg = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\test2.bmp";
//Read Image Bytes into a byte array
//Initialize byte array with a null value initially.
byte[] imageData = null;
//Use FileInfo object to get file size.
FileInfo fInfo = new FileInfo(strimg);
&nb
Ïà¹ØÎĵµ£º
ÔÒò£ºIISûÓÐ×¢²á
½â¾ö°ì·¨£º
ÔÚCMDÖнøÈëĿ¼C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727£¬ÔËÐÐaspnet_regiis
1¡¢aspnet_regiis -ga administrator£¨administratorΪµ±Ç°Óû§£©
2¡¢aspnet_regiis -i £¨×¢²áIIS£©
3¡¢iisreset /noforce £¨ÖØÆôIIS£©
²Ù×÷Ïêϸ£º
C:\Documents and Settings\Administrator>cd ......
·Ö²¼Ê½(Distributed)Êý¾Ý·ÃÎʲã(Data Access Layer)(ÒÔϼò³ÆDAL)ÊÇ×ÛºÏMySQL Proxy¡¢Memcached¡¢¼¯ÈºµÈµÈ¼¼ÊõÓÅµã¶ø¹¹½¨µÄÒ»¸öÈí¼þϵͳ¡£Ä¿µÄÊÇΪÁ˽â¾öÔÚ¹¹½¨´óÖÐÐÍÍøÕ¾Ê±Óöµ½µÄºÍÊý¾Ý·ÃÎÊÓйصÄÖî¶àÎÊÌ⣬ÈçÔõôʹµÃÇпâ·Ö±í͸Ã÷»¯£¬ÈçºÎʹµÃ»º´æ´æÈ¡Çå³ý×Ô¶¯»¯£¬ÔõÑù²ÅÄܸüºÃµØ·ÀÖ¹·þÎñµ¥µã¹ÊÕÏµÈµÈ ......
import java.sql.*;
public class ConnectAccess {
/**
* ³õѧÕßÇë×¢Ò⣺
* 1:ÏȽ¨Á¢Ò»¸öaccessÎļþa1.mdb,²¢·ÅÔÚD:\ÏÂ;
* 2:ÔÚÊý¾Ý¿âÎļþa1.mdbÖн¨Á¢Ò»¸ö±íTable1£»
* 3£ºÎªTable1Ìí¼ÓÒ»ÁУ¬²¢²åÈëÖÁÉÙÒ»Ìõ¼Ç¼£»
* 4£º±¾ÎÄÊÇÒ»¸öÍêÕûµÄÀֱ࣬½ÓÄÃÈ¥ÔËÐоͿÉÒÔ¡£
*/
public static void main(Stri ......
accessÈÕÆÚºÍʱ¼äº¯Êý
accessÈÕÆÚºÍʱ¼äº¯Êý
------------------------------------------------
ÉèÖõ±Ç°ÈÕÆÚ»òʱ¼ä¡£ Date ,Now, Time
¼ÆËãÈÕÆÚ: DateAdd, DateDiff, DatePart
·µ»ØÈÕÆÚ: DateSerial, DateValue
·µ»ØÊ±¼ä: TimeSerial, TimeValue
ÉèÖÃÈÕÆÚ»òʱ¼ä: Date, Time
¼ÆÊ±: Timer
ÔÚ°ïÖú ......
ËäÈ»Firebird×ÜÌåÉÏÊDZÈAccessºÃ£¬µ«ÊÇûÓд«ËµµÄÄÇôºÃ£¬ÖÁÉÙÔÚNet»·¾³Ï¡£
1¡¢²âÊÔ»·¾³
¡¡¡¡A¡¢ÏµÍ³»·¾³
¡¡¡¡²Ù×÷ϵͳ£ºWindows XP Professional Server Pack 2
¡¡¡¡CPU£ºIntel(R) Pentium(R) 4 CPU 3.00GHZ 2.99GHZ
¡¡¡¡Äڴ棺1G
¡¡¡¡B¡¢´úÂë»·¾³
¡¡¡¡NET2.0¡¢Access2003¡¢Firebird2.1¡¢
¡¡¡¡FirebirdµÄNET2.0· ......