C#Á¬½ÓACESSʱ£¬sqlÓï¾äÓдí
ÔÚдsqlÓï¾äʱ£¬Ò»°ã¶¼ÊÇÒ»¾ä½â¾ö£¬´ÓÀ´Ã»Ïë¹ý˵£¬°ÑsqlÓï¾ä²ð¿ªÀ´Ð´¡£
ÀýÈçÏÂÃæÕâ¾ä£º string readstring = "select * from ʵÀý where ʵÀýID='"+eid+"'";
È»ºóÖ´ÐÐ Myconnection();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(readstring, Mycon);
Õâʱºò¾Í»á±¨´í¡£¡£²»ÊÇ˵“sqlÓï¾äÓд픣¬¾ÍÊÇ“Êý¾ÝÀàÐͲ»Æ¥Å䔣¬¸üÂé·³µÄÊÇ£¬ÔËÐгɹ¦ÁË£¬µ«ÊÇÔËÐеĽá¹ûÒ»Ö±ÓÐ´í¡£¡£
ºóÀ´£¬²Å·¢ÏÖÔÀ´Èç¹ûÁ¬½ÓµÄÊÇacessµÄ»°£¬ÒÔÉϵÄÕâ¾äsqlÊÇÒª±ä³ÉÏÂÃæÕâÑùдµÄ£º
string readstr = "select * from ʵÀý where ʵÀýID=";
string readstring = readstr + eid;
ÏñÏÂÃæÕâÑùµÄ´úÂ룬²ÅÄÜÔËÐÐÎÞÎó£º
int eid = Form1.int_selected + 1;
string readstr = "select * from ʵÀý where ʵÀýID=";
string readstring = readstr + eid;
Myconnection();//Á¬½ÓÊý¾Ý¿â
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(readstring, Mycon);
da.Fill(ds, "ʵÀý");
qbox1.Text = ds.Tables[0].Rows[0][3].ToString();
dxbox1.Text = ds.Tables[0].Rows[0][4].ToString();
Ïà¹ØÎĵµ£º
Õû¸öSQLºÍAsp.net(vb.net)Ò»Æð´ò°üµÄÈ«¹ý³ÌдһÏ¡£
Ò».×¼±¸±ØÒªµÄÎļþ
1. SQL½Å±¾Îļþ£¬Éú³ÉÒÔºó°²×°¹ý³ÌÖÐÐèÒªµÄ±íºÍ´æ´¢¹ý³ÌµÈµÈ£»
Éú³ÉÖ®ºó£¬¾ÍÔÝʱ°ÑËüÃüÃûΪdb.sql(×¢Òâ´óСд)
2.LisenceFile.rtfµÄ°²×°Îļþ£¬ÒòΪÎÒµÄϵͳÊǸöÈ˵쬶øÇÒfreeµÄ£¬ËùÒÔ¾ÍûÓÐ×ö¡£Õâ¸öÒÔºóÒ²ÊÇÒªÓõ½µÄ¡£
¶þ.ÔÚ×Ô¼ºÏÖÓеÄÏîÄ¿Àïà ......
´íÎóÌáʾ£¬ÓÐÒ»¸öÎļþÒѾ¹ÒÆð£¬±ØÐëÖØÐÂÆô¶¯¼ÆËã»ú¡£ÖØÐÂÆô¶¯£¬Ôٴΰ²×°ÈÔÈ»ÊÇͬÑùµÄÎÊÌâ¡£
×¢²á±í¼üÖµµÄÎÊÌâ¡£½â¾ö·½·¨£º
ֻҪɾ³ý\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\ϵÄPendingFileRenameOperations¼üÖµ£¬¾Í¿ÉÒÔÖØÐ°²×°ÁË¡£
ɾ³ýºó°²×°£¬²»±ØÖØÐÂÆô¶¯¼ÆËã»ú¡£ ......
---Ò»¸öÔµĵÚÒ»Ìì
SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
--- ±¾ÖܵÄÐÇÆÚÒ»
SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
---Ò»ÄêµÄµÚÒ»Ìì
SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
----¼¾¶ÈµÄµÚÒ»Ìì
SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)
----ÉϸöÔµÄ×îºóÒ»Ìì
......
ÓйطÖÒ³ SQL µÄ×ÊÁϺܶ࣬ÓеÄʹÓô洢¹ý³Ì£¬ÓеÄʹÓÃÓαꡣ±¾È˲»Ï²»¶Ê¹ÓÃÓα꣬ÎÒ¾õµÃËüºÄ×Ê¡¢Ð§Âʵͣ»Ê¹Óô洢¹ý³ÌÊǸö²»´íµÄÑ¡Ôñ£¬ÒòΪ´æ´¢¹ý³ÌÊǾ¹ýÔ¤±àÒëµÄ£¬Ö´ÐÐЧÂʸߣ¬Ò²¸üÁé»î¡£ÏÈ¿´¿´µ¥Ìõ SQL Óï¾äµÄ·ÖÒ³ SQL °É¡£
·½·¨1£º
ÊÊÓÃÓÚ SQL Server 2000/2005
SELECT TOP Ò³´óС *
from tab ......
*
* ¹¦ÄÜ˵Ã÷:±¸·ÝºÍ»Ö¸´SQL ServerÊý¾Ý¿â
* ×÷Õß: Áõ¹¦Ñ«;
* °æ±¾:V0.1(C#2.0);ʱ¼ä:2007-1-1
* µ±Ê¹ÓÃSQL Serverʱ,ÇëÒýÓà COM×é¼þÖеÄ,SQLDMO.dll×é¼þ
* µ±Ê¹ÓÃAccessÖÐ,Çëä¯ÀÀÌí¼ÓÒýÓÃÒÔÏÂÁ½¸ödll
* ÒýÓÃC:/Progra ......