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

sql ÎÊÌâ

PBÖпª·¢µÄ¡£

DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)

string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime < '"+endTime+"')"

ÕâÑùдÓÐÎÊÌâÂð£¬StartTime, EndTimeÔÚÊý¾Ý¿âÖÐÊÇdatetimeÀàÐÍ
×îºÃÓòÎÊý»¯µÄÐÎʽд.

PB²»¶®£¡Â¥Ï¼ÌÐø

ÄܾٸöÀý×ÓÂð£¬Ð»Ð»
ÒýÓÃ
×îºÃÓòÎÊý»¯µÄÐÎʽд.


C# code:
string sql = xx + " where startTime > @startTime and EndTime < @endTime";
SqlCommand cmd = new SqlCommand(sql,con);
cmd.Parameters.Add("@startTime",SqlDbType.DateTime);
cmd.Parameters.Add("@endTime",SqlDbType.DateTime);

cmd.Parameters["startTime"].Value = xx;
cmd.Parameters["endTime"].Value = xx;

cmd.ExecuteNonQuery();


PBÀïÃæ¿ÉÒÔÕâôÓÃô£¿/СÁº´ó´ó

DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)

--MSSQL
string sql
sql = dw_1.GetSQLSelect()+" Where (StartTime> '"+em_1.Text+"') and (EndTime < '"+em_2.Text+"')"

SQL code



Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.


Ïà¹ØÎÊ´ð£º

SQL serverÊý¾Ý¼¯³ö´íÇóÖú

Á½ÖÖ´íÎó£º
1.Èç¹ûÎÒÕâÑùÉêÃ÷£ºResultSet rs;´íÎóÌáʾÈçÏ£º

An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48:    ......

SQLÌæ»»×Ö·û´®µÄÎÊÌâ

¸÷λ´óÏÀ£¬ÓиöÎÊÌâÇë½Ì£¬ÎÒÏÖÔÚÓÐÁ½ÕűíA,B×ֶζ¼ÓÐnum£¬Èç
A                    B
num                  ......

myeclipseÖÐÈçºÎÓëSQL server2008 Á¬½Ó

ÔÚ΢Èí¹Ù·½ÏÂÔØÁËÒ»¸ösqljdbc_2.0Çý¶¯°ü£¬ÏëÓÃsqlserver2008Á¬½Ó¡£µ«×ÜÊÇÔÚÁ¬½ÓÊý¾Ý¿âʱÌáʾ³ö´í£¨ÓÐÒ»µãҪ˵Ã÷µÄÊÇÎҵĵçÄÔÀïÓÐÁ½¸öÊý¾Ý¿â°æ±¾Ò»¸öÊÇsqlserver2005(ĬÈϵÄʵÀý)»¹ÓÐÒ»¸ö¾ÍÊÇsqlserver2008(ÐèÒªÖ¸¶¨Ê ......

sql ÈçºÎ¼Ó±íµÄÅÅËûËø

ÒòΪÊǶà¿Í»§¶Ë²Ù×÷µÄ£¬ËùÒÔÏ£ÍûÔÚ¸üеÄʱºò£¬¿ÉÒ԰ѱíÓÃÅÅËûËøËø×¡£¬ÆäËûÓû§²»¿ÉÒÔ²éѯºÍÐÞ¸Ä

֮ǰ¿´µ½Ïà¹ØÎÊÌâÀïÃæÌáµ½ WITH  (XLOCK) £¬ÎÒÕâÀï¿ÉÒÔÓÃÕâ¸öÂð£¿

WITH  (XLOCK) ÓÃÍêÖ® ......

Çë¸ßÊÖ°ïÎÒдһÌõsqlÓï¾ä

ǰ¼¸Ìì¹«Ë¾ÃæÊÔ£¬¼ûµ½Ò»Ìâ,Çë¸ßÊÖ°ïÎÒ½â´ð£¬Ð»Ð»£¡

ÄÚÈÝtable:
id    name    parentid
1      aaa    null
14    bbb    1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ