C#Á¬½ÓAccessÊý¾Ý¿âÎÊÌâ - .NET¼¼Êõ / C#
ÎÒдÁËÒ»¶ÎºÜ¼òµ¥µÄÓÃado.netÁ¬½ÓÊý¾Ý¿âµÄ´úÂ룬¿ÉÊÇÔËÐкóÌáʾûÊ¿ɰ²×°µÄISAM£¡
ÕâÊÇʲôÒâ˼£¿ÎÒ¸ÃÔõô×ö²ÅÄÜÕý³£Á¬½Ó¡£
´úÂëÈçÏ£º
C# code:
static void Main(string[] args)
{
OleDbConnection thisConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=Human.mdb");
thisConnection.Open();
OleDbCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "SELECT xm,xb from human";
OleDbDataReader thisReader = thisCommand.ExecuteReader();
while(thisReader .Read())
{
Console.WriteLine("\t{0}\t{1}",thisReader["xm"],thisReader ["xb"]);
}
thisReader.Close ();
thisConnection.Close();
Console .Write ("Program finished,press Enter/Return to continue:");
Console.ReadLine();
}
Á¬½Ó×Ö·û´®²»ÕýÈ·¡£
лл°¡ ÔÀ´ÊÇÕâÑù°¡
Ïà¹ØÎÊ´ð£º
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ͦ·±Ëö£¬Ö®Ç°·¢µÄÌû×Ó£¬·Öֵ̫µÍÏÖÔÚÖØ·¢Ò»¸ö¡£»¶Ó¸÷λ´óÏÀ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
ÎÒÁ¬½ÓaccessÊý¾Ý¿â£¬ÒÔÇ°Ò»Ö±ºÜºÃ£¬×î½üÈ´×ÜÊdzö´í£¨Êý¾Ý¿âÁ¬½Ó³ö´í!£¡£©£¬´úÂëÈçÏ£º
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&" ......