C# ¸üÐÂaccessÎÊÌ⣡´óÏÀÇë½ø
1.ÕâÑù¿ÉÒÔ£º
command.CommandText = @"Update college Set name='mick' where ID=" + textBox3.Text;
2.ÕâÑùÈ´²»ÐУº
command.CommandText = @"Update college Set name=" + textBox1.Text + @"where ID=" + textBox3.Text;
´íÎóÐÅÏ¢£º
δ´¦ÀíµÄ¡°System.Data.OleDb.OleDbException¡±ÀàÐ͵ÄÒì³£³öÏÖÔÚ System.Data.dll ÖС£
ÆäËûÐÅÏ¢: Óï·¨´íÎó (²Ù×÷·û¶ªÊ§) ÔÚ²éѯ±í´ïʽ 'mickwhere ID=1' ÖС£
3.ÕâÑùÈÔÈ»²»ÐУº£¨whereÇ°Ãæ¼ÓÁ˸ö¿Õ¸ñ£©
command.CommandText = @"Update college Set name= " + textBox1.Text + @" where ID=" + textBox3.Text;
´íÎóÐÅÏ¢£º
δ´¦ÀíµÄ¡°System.Data.OleDb.OleDbException¡±ÀàÐ͵ÄÒì³£³öÏÖÔÚ System.Data.dll ÖС£
ÆäËûÐÅÏ¢: ÖÁÉÙÒ»¸ö²ÎÊýûÓб»Ö¸¶¨Öµ¡£
ÇëÎÊÓ¦ÈçºÎ´¦Àí£¿
¼± ¶àл£¡£¡£¡£¡
2.ÕâÑùÈ´²»ÐУº
command.CommandText = @"Update college Set name=" + textBox1.Text + @"where ID=" + textBox3.Text;
´íÎóÐÅÏ¢£º
δ´¦ÀíµÄ¡°System.Data.OleDb.OleDbException¡±ÀàÐ͵ÄÒì³£³öÏÖÔÚ System.Data.dll ÖС£
ÆäËûÐÅÏ¢: Óï·¨´íÎó (²Ù×÷·û¶ªÊ§) ÔÚ²éѯ±í´ïʽ 'mickwhere ID=1' ÖС£
˵µÄºÜÇå³þÁË, Óï·¨´íÎó name='" + textBox1.Text + "' where ID=" whereÇ°Ãæ¼Ó¿Õ¸ñ,textÄÚÈÝÓÃÒýºÅ
ÊÔÊÔÂ¥Éϵķ½·¨£¬°Ñµ¥ÒýºÅ°üº¬ÔÚ×Ö·û´®ÀïÃæ¡£
textBox1.Text ×Ö·û´®Ç°ºó¼Ó µ¥ÒýºÅ:
command.CommandText = @"U
Ïà¹ØÎÊ´ð£º
ÍøÉÏ¿´Á˺ܶ࣬ºÃÏñÕâÑùµ÷ÓúܺãºExcel.Application();
µ«ÊÇÐèÒªÒýÈëʲôÃüÃû¿Õ¼ä»òÕßdll²ÅÄÜÔËÐÐExcelÕâ¸öÀàÄØ£¿
Excel.dll
Excel.dllÔÚExcel°²×°³ÌÐòÏ£¬
using Microsoft.Office.Interop.Excel;
......
_RecordsetPtr CMyAdo::SelectRecord(string &where, string &tablename,string &field, int way )
{
int ret = 0;
_RecordsetPtr pset;
CString sql;
& ......
×î½ü×¼±¸Îª¹«Ë¾ÍøÕ¾ÓÃVB×ö¸ö²úƷչʾÉú³É£¬Éú³É²¿·Ö»ù±¾Ã»ÎÊÌ⣬
ÎÊÌâ³öÏÖÔÚ²éѯ²¿·Ö£¬Ê¹ÓÃÁËMSHFelxGrid(DATAGrid²»ÄÜÂú×ã²Ù×÷ÐèÇó)£¬±¾À´ÒÔΪÊÕ¹¤ÁË£¬×òÌìÔٴβâÊÔµÄʱºò·¢ÏÖÁËÒÔÏÂÎÊÌâ
µ±Êý¾Ý¿â×Ö¶ÎΪ¡ ......
Òª×éºÏ4ÕűíµÄ²éѯ£¬·Ö±ðÊÇA±í£¬B±í£¬C±í£¬D±í£»
A±í
Game_id Game_Name
1 abc
B±í
Category_ID Category_Name Game_id
& ......