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

Sql helperʹÓ÷½·¨

    public List<FirmAttachmentModel> LoadFirmAttachmentByFirmId(int FirmId, int pageIndex, int pageSize)
        {
            List<FirmAttachmentModel> result = new List<FirmAttachmentModel>();
            SqlDataReader dataReader = null;
            try
            {
                dataReader = SqlHelper.ExecuteReader(SqlHelper.ConnectionString, CommandType.StoredProcedure, "sp_LoadFirmAttachmentByFirmId", new SqlParameter[] { new SqlParameter("@FirmId", FirmId), new SqlParameter("@pageIndex", pageIndex), new SqlParameter("@pageSize", pageSize) });
                while (dataReader.Read())
                {
                    FirmAttachmentModel model = new FirmAttachmentModel
                    {
                        AttachmentTypeId = Convert.ToInt32(dataReader["AttachmentTypeId"]),
                     };
                    result.Add(model);
                }
 &


Ïà¹ØÎĵµ£º

SQLÖеÄCASE WHENʹÓÃ

Case¾ßÓÐÁ½ÖÖ¸ñʽ¡£¼òµ¥Caseº¯ÊýºÍCaseËÑË÷º¯Êý¡£
--¼òµ¥Caseº¯Êý
CASE sex
         WHEN '1' THEN 'ÄÐ'
         WHEN '2' THEN 'Å®'
ELSE 'ÆäËû' END
--CaseËÑË÷º¯Êý
CASE WHEN sex = '1' THEN 'ÄÐ'
     ......

sqlÖÐ in ¡¢not in ¡¢exists¡¢not exists Ó÷¨ºÍ²î±ð


exists £¨sql ·µ»Ø½á¹û¼¯ÎªÕ棩 
not exists (sql ²»·µ»Ø½á¹û¼¯ÎªÕ棩 
ÈçÏ£º 
±íA 
ID NAME 
1    A1 
2    A2 
3  A3 
±íB 
ID AID NAME 
1    1 B1 
2  & ......

SQL ÖÐWith as µÄÓ÷¨

Ò»£®WITH ASµÄº¬Òå
WITH AS¶ÌÓҲ½Ð×ö×Ó²éѯ²¿·Ö£¨subquery factoring£©£¬¿ÉÒÔÈÃÄã×öºÜ¶àÊÂÇ飬¶¨ÒåÒ»¸öSQLƬ¶Ï£¬¸ÃSQLƬ¶Ï»á±»Õû¸öSQLÓï¾äËùÓõ½¡£ÓеÄʱºò£¬ÊÇΪÁËÈÃSQLÓï¾äµÄ¿É¶ÁÐÔ¸ü¸ßЩ£¬Ò²ÓпÉÄÜÊÇÔÚUNION ALLµÄ²»Í¬²¿·Ö£¬×÷ΪÌṩÊý¾ÝµÄ²¿·Ö¡£
ÌØ±ð¶ÔÓÚUNION ALL±È½ÏÓÐÓá£ÒòΪUNION ALLµÄÿ¸ö²¿·Ö¿ÉÄÜÏàͬ£¬µ ......

Weblogic8.1Á¬½ÓSQL Server 2005(ת)

   weblogic8.1ûÓдøSQL Server 2005µÄJDBCÇý¶¯£¬ÐèҪȥ΢ÈíÍøÕ¾ÏÂÔØ¡£
    µØÖ·£ºhttp://msdn.microsoft.com/vstudio/express/sql/download/
    Æô¶¯   SQL Server Configuration manager£¬Õ¹¿ªSQL Server 2005
ÍøÂçÅäÖ㬵¥»÷“MSSQLSERVERµÄЭÒé&rdqu ......

java Á¬½Ó sql 2005 µÄ·½·¨

java Á¬½Ó sql 2005 µÄ·½·¨£º
 1¡£µ½Î¢Èí¹Ù·½ÍøÕ¾ÏÂÔØ2005µÄjdbc²¢½âѹ£¬»ñµÃÎļþsqljdbc.jar
2¡£¸´ÖÆÎļþsqljdbc.jarµ½jdkĿ¼\jdk1.5\jre\lib\extÏ¡£
 3¡£¿ªÊ¼-¡µ³ÌÐò-¡µsql server 2005-¡µÅäÖù¤¾ß-¡µSQL Server Configuration Manager¡£Æô¶¯sql 2005·þÎñ¡£
µã»÷ sql server2005ÍøÂçÅäÖýڵ㣬²¢Ñ¡ÖÐ&rd ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ