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#»ñÈ¡×Ö·û´®µÄ³¤¶È
×÷Õߣºylclass À´Ô´£º²©¿ÍÔ° ·¢²¼Ê±¼ä£º2009-10-30 16:25 ÔĶÁ£º193 ´Î ÔÎÄÁ´½Ó [ÊÕ²Ø]
1¡¢ ʹÓÃg.MeasureString£¨£©»ñµÃ
ʹÓÃMeasureString²âÁ¿³öÀ´µÄ×Ö·û¿í¶È£¬×ÜÊDZÈʵ¼Ê¿í¶È´óһЩ£¬¶øÇÒËæ×Å×Ö·û ......
×Ö·û´®µÄ¿í¶È×ÔÊÊÓ¦ÈÝÆ÷
Graphics g = Graphics.fromImage(new Bitmap(1, 1));
SizeF size = g.MeasureString(lblTitle.Text, new Font("ËÎÌå", 24 * 0.0625F, FontStyle.Bold));
float oldSize=(800*0.0625F);//1px=0.0625em
float newSize = (0.75F/size.Width )* oldSize;
size.Width µÄµ¥ ......
IndexOf()
²éÕÒ×Ö´®ÖÐÖ¸¶¨×Ö·û»ò×Ö´®Ê״γöÏÖµÄλÖÃ,·µÊ×Ë÷ÒýÖµ£¬È磺
str1.IndexOf("×Ö")£» //²éÕÒ“×Ö”ÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö´®")£»//²éÕÒ“×Ö´®”µÄµÚÒ»¸ö×Ö·ûÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö",start,end)£»//´Óstr1µÚstart+1¸ö×Ö·ûÆ𣬲éÕÒend¸ö×Ö·û£¬²éÕ ......
c#ÖÐÁ½ÖÖ²ÎÊý´«µÝ·½Ê½£¬refºÍ·Çref£¬Ò»Ð©ÈË»á¾õµÃÊÇ·ñ²ÉÓÃref´«µÝ»áÓиü¸ßµÄЧÂÊ£¬Êµ¼ÊÄØ£¿ÏÂÃæ·Ö±ð¿´Ï¡£
1¡¢ÖµÀàÐͲÎÊývoid FuncA(int iArg1,double dArg1,ref int iArg2,ref double dArg2)¡£
iArg1ºÍdArg1²»¼Óref£¬´ËʱµÄÈ·»áÔÚÕ»À�±´Ò»·ÝÖµ£¬µ«Í¬Ê ......
function loginNull()
{
if (document.form1.txtName.value =="")
{
//alert("ÇëÌîдÄúµÄÓû§Ãû£¡");
WebForm1.show("Óû§Ãû´íÎó,²»ÄÜΪ¿Õ").value;
//alert("ÇëÌîдÄúµÄÓû§Ãû£¡");
document.form1.txtName.focus();
return false;
}
var filter=/^s*[.A-Za-z0-9_-]{5,15}s*$/;
if (!filter.test(document.form ......