Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#²Ù×÷AccessÀà Re

using System;
using System.Data;
using System.Data.OleDb;
namespace AccessDb
{
/**//// <summary>
/// AccessDb µÄժҪ˵Ã÷£¬ÒÔÏÂÐÅÏ¢ÇëÍêÕû±£Áô
/// ÇëÔÚÊý¾Ý´«µÝÍê±Ïºóµ÷ÓÃClose()·½·¨£¬¹Ø±ÕÊý¾ÝÁ´½Ó¡£
/// </summary>
public class AccessDbClass
{
±äÁ¿ÉùÃ÷´¦#region ±äÁ¿ÉùÃ÷´¦
public OleDbConnection Conn;
public string ConnString;//Á¬½Ó×Ö·û´®
#endregion
¹¹Ô캯ÊýÓëÁ¬½Ó¹Ø±ÕÊý¾Ý¿â#region ¹¹Ô캯ÊýÓëÁ¬½Ó¹Ø±ÕÊý¾Ý¿â
/**//// <summary>
/// ¹¹Ô캯Êý
/// </summary>
/// <param name="Dbpath">ACCESSÊý¾Ý¿â·¾¶</param>
public AccessDbClass(string Dbpath)
{
ConnString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
ConnString += Dbpath;
Conn = new OleDbConnection(ConnString);
Conn.Open();
}
/**//// <summary>
/// ´ò¿ªÊý¾ÝÔ´Á´½Ó
/// </summary>
/// <returns></returns>
public OleDbConnection DbConn()
{
Conn.Open();
return Conn;
}
/**//// <summary>
/// ÇëÔÚÊý¾Ý´«µÝÍê±Ïºóµ÷Óøú¯Êý£¬¹Ø±ÕÊý¾ÝÁ´½Ó¡£
/// </summary>
public void Close()
{
Conn.Close();
}
#endregion
Êý¾Ý¿â»ù±¾²Ù×÷#region Êý¾Ý¿â»ù±¾²Ù×÷
/**//// <summary>
/// ¸ù¾ÝSQLÃüÁî·µ»ØÊý¾ÝDataTableÊý¾Ý±í,
/// ¿ÉÖ±½Ó×÷ΪdataGridViewµÄÊý¾ÝÔ´
/// </summary>
/// <param name="SQL"></param>
/// <returns></returns>
public DataTable SelectToDataTable(string SQL)
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand command = new OleDbCommand(SQL, Conn);
adapter.SelectCommand = command;
DataTable Dt = new DataTable();
adapter.Fill(Dt);


Ïà¹ØÎĵµ£º

C# Home / Ïê½âAsp.Net SqlÊý¾Ý¿âÁ¬½Ó×Ö·û´®

1.Á¬½ÓÊý¾Ý¿âÎļþ
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
SqlConnectionStringBuilderʵÀý»¯Ê±£¬ÒªÓõ½connectionString£¬È磺SqlConnectionStringBuild builder = new SqlCon ......

¡¶Visual C# ×î¼Ñʵ¼ù¡·µÚÒ»Õ ³ÌÐòÉè¼Æ (Èý)

 
µÚÒ»Õ ³ÌÐòÉè¼Æ
¡¡¡¡“ÒªÏë³ÉΪÕæÕýµÄ³ÌÐòÔ±£¬ÎÒÃÇÐèÒª½øÐÐÒ»³¡Ï´Àñ¡£”
¡¡¡¡“³ÌÐò = Êý¾Ý½á¹¹ + Ëã·¨¡£”ÕâÑùµÄ¹«Ê½ºÜ¾«±Ù£¬ËüÔ½¹ýÁ˱í²ãÖ±½ÓÃèÊöÁ˳ÌÐòµÄ±¾ÖÊ¡£²»½öÈç´Ë£¬ÕâÑù¼¸¸ö¼òµ¥µÄµ¥´ÊÒ²ÈÃÎÒÃÇÃ÷°×“ÎÒÃÇÓ¦¸ÃѧϰʲôÄÚÈÝ£¿”¡£ÈËÃÇ×öÈκÎʶ¼ÓÐÒ»¶¨µÄ³ÌÐò£¬Ö»ÊÇûÓÐÒâÊ ......

C#ÖеÄ==,!=µÈ·ûºÅÖØÔØ£¬ÒÔ¼°ÖØÔصȺŲÙ×÷

ͨ¹ýÒ»¸öʵ¼ÊµÄÀý×ÓÀ´½éÉÜ¡£ÆäÖÐÖØÔØ==£¬!=,Equal,GetHashCodeº¯Êý¡£
public class Record
{
public string[] arr = null;
public bool hasEqual = false;
//ÖØÔØÒ»¸öϱêÔËËã·ûºÅ
public string this[int index]
{
get
{
return arr[index];
}
set
{
arr[index] = value;
}
}
public override int GetHas ......

c# ref²ÎÊý´«µÝÕæÃæÄ¿

   c#ÖÐÁ½ÖÖ²ÎÊý´«µÝ·½Ê½£¬refºÍ·Çref£¬Ò»Ð©ÈË»á¾õµÃÊÇ·ñ²ÉÓÃref´«µÝ»áÓиü¸ßµÄЧÂÊ£¬Êµ¼ÊÄØ£¿ÏÂÃæ·Ö±ð¿´Ï¡£
   1¡¢ÖµÀàÐͲÎÊývoid FuncA(int iArg1,double dArg1,ref int iArg2,ref double dArg2)¡£
       iArg1ºÍdArg1²»¼Óref£¬´ËʱµÄÈ·»áÔÚÕ»À�±´Ò»·ÝÖµ£¬µ«Í¬Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ