¹ØÓÚACCESSÏÂOleDbParameterµÄʹÓÃ
½ñÌ죬»¹ÊÇÔÚ×öÄǸöÏîÄ¿£¬ÒÀȻʹÓÃÍù³£µÄsqlhelperÓ÷¨£¬Íù³£µÄÊý¾Ý¿â²Ù×÷À࣬µ«ÊÇÆ«Æ«µ÷ÊÔ²»³É¹¦£¬¶øÇÒ×îÖØÒªµÄÊÇ£¬Ëü²»±¨´í
ÖÐÎç³Ô·¹»ØÀ´£¬±¾À´Ïë´òËã˯¸öÎç¾õµÄ£¬µ«ÊÇÏîÄ¿Ì«½ôÆÈÁË£¬ÓÚÊÇÓÖ¸ú³µ³µÑо¿ÁËÒ»ÖÐÎ磬×îºó£¬·¢ÏÖÈç¹û²»ÓÃ@²ÎÊý´«µÝµÄ»°£¬ÊÇÕý³£ÔËÐеģ¬ÓÚÊÇ°Ù¶ÈÁËһϣ¬ÄÇЩÈË˵ҪÓÓ£¿”µ±Õ¼Î»·û
ÎÒÏëÏë¾õµÃ²»ÕýÈ·£¬ÓÚÊÇ×öÁËÒ»¸öʵÑ飬·¢ÏÖÄÇÊǼٻ°
ÍíÉÏ»ØÀ´£¬¹úÁú°ïÎÒ½â¾öÁËÕâ¸öÎÊÌâÁË
ÔÀ´£¬sqlhelper¶Ô²ÎÊý¸³ÖµµÄʱºò£¬ÊÇÑ»·À´¸³ÖµµÄ£¬Ò²¾ÍÊÇ˵£¬string sql="";ÖеIJÎÊýλÖã¬Óë
OleDbParameter[] paras ={ new OleDbParameter("@introduction",company.Introduction),
new OleDbParameter("@company_ID",company.Company_ID)
};ÖвÎÊýµÄλÖÃÒª¶ÔÓ¦£¬
ÆäʵÏëÏëÒ²ÊÇ
²ÎÊý¸³Öµ´íÎó£¬×î¶à¾ÍÖ´Ðв»ÕýÈ·£¬²»»á³öÏÖ±¨´íµÄ
Ïȹ«²¼´úÂë°É£¡£¡£¡
public bool Update_Company(Company company)
{
bool flag = false;
string sql = "update tb_company set introduction=@introduction where company_ID=@company_ID";
OleDbParameter[] paras ={ new OleDbParameter("@introduction",company.Introduction),
new OleDbParameter("@company_ID",company.Company_ID)
};
int res = SqlHelper.doExecuteNonQuery(sql, paras);
if (res > 0)
{
flag = true;
}
return flag;
}
public int doExecuteNonQuery(string sql,OleDbParameter[] prams)
{
cmd = new OleDbCommand(sql, GetConn());
// cmd.Parameters.Add("introduction", OleDbType.VarChar, 1000, "introduction").Value = new Company().Introduction;
//cmd.Parameters.Add("company_ID", OleDbTyp
Ïà¹ØÎĵµ£º
JDBCÁ¬½ÓMySQL
¼ÓÔؼ°×¢²áJDBCÇý¶¯³ÌÐò
Class.forName("com.mysql.jdbc.Driver");
Class.forName("com.mysql.jdbc.Driver").newInstance();
JDBC URL ¶¨ÒåÇý¶¯³ÌÐòÓëÊý¾ÝÔ´Ö®¼äµÄÁ¬½Ó
±ê×¼Óï·¨£º
<protocol£¨Ö÷ҪͨѶÐÒ飩>:<subprotocol£¨´ÎҪͨѶÐÒ飬¼´Çý¶¯³ÌÐòÃû³Æ£©>:<da ......
ÏÂÃæ¸ø³öÁËʹÓÃC# ¿ª·¢µÄÒ»¸öѹËõACCESSÊý¾Ý¿âµÄ³ÌÐò
ÏñFolderBrowserDialog£¨ÓÃÓÚä¯ÀÀÑ¡ÔñÎļþ¼ÐµÄ¶Ô»°¿ò£©¡¢MessageBox£¨ÏûÏ¢´¦Àí¶Ô»°¿ò£©¡¢DirectoryInfo£¨Ä¿Â¼ÐÅÏ¢£¬¿ÉÓÃÓÚ´´½¨¡¢¼ì²âÊÇ·ñ´æÔڵȶÔĿ¼µÄ²Ù×÷£©¡¢FileInfo£¨ÎļþÐÅÏ¢£¬¿ÉÓÃÓÚÎļþµÄ¼ì²â¡¢ÎļþÐÅÏ¢µÄ»ñÈ¡¡¢¸´ÖƵȲÙ×÷£©¡¢DataGridView£¨Êý¾Ý±í¸ñ¿Ø¼þ£¬ÓÃÓ ......
http://www.tongyi.net/article/20031101/200311013786.shtml
ËùνµÄÊý¾Ý´«Ê䣬ÆäʵÊÇÖ¸SQLServer·ÃÎÊAccess¡¢Excel¼äµÄÊý¾Ý¡£
ΪʲôҪ¿¼Âǵ½Õâ¸öÎÊÌâÄØ£¿
ÓÉÓÚÀúÊ·µÄÔÒò£¬¿Í»§ÒÔÇ°µÄÊý¾ÝºÜ¶à¶¼ÊÇÔÚ´æÈëÔÚÎı¾Êý¾Ý¿âÖУ¬ÈçAcess¡¢Excel¡¢Foxpro¡£ÏÖÔÚϵͳÉý¼¶¼°Êý¾Ý¿â·þÎñÆ÷ÈçSQLServer¡¢ORACLEºó£¬¾³£ÐèÒª·ÃÎÊÎı¾Êý ......
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
static class Program
{
......