linq to sql Ïê
×î½üѧϰ linq to sql ¸Ð¾õ»¹ÊÇ¿ÉÒԵ쬷½±ã¿ì½Ý£¬ÒÔǰÎÊÊÇÒÔΪ²»ºÃÓ㬲»ÏëÓ㬵«ÊǽñÌìÓÃÁËһϸоõ»¹ÊDz»´íµÄ£¬ ȷʵÊǿ죬µ«ÊÇÎÒÓÖÔÚÏë
Èç¹û³ö´íÁËÔõô°ì£¬ÕâÑùÒ»¸öÀàÀï·ÅÄÇô¶àµÄÎļþÊÇÓе㲻ºÃ£¬ÔÙ˵ÁË linq to sql µÍ²ã²»ÖªµÀÔõôʵÏֵ쬻¹ÊÇûÓÐ×Ô¼ºÐ´µÄ·ÃÎʸоõÊæ·þµãºÇºÇ£¡£¡£¡
Èç¹ûÊÇ¿ìËÙ¿ª·¢Óà linq to sql »¹ÊDz»´íµÄÑ¡Ôñ°¡£¡£¡£¡
-
»ù±¾µÄÔöɾ³ý¸Ä²é
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
namespace WebServiceText
{
/// <summary>
/// Service1 µÄժҪ˵Ã÷
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// ÈôÒªÔÊÐíʹÓà ASP.NET AJAX ´Ó½Å±¾Öе÷ÓÃ´Ë Web ·þÎñ£¬ÇëÈ¡Ïû¶ÔÏÂÐеÄ×¢ÊÍ¡£
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
DataClasses1DataContext context = new DataClasses1DataContext();
[WebMethod]
public List<Text> selectSwhere(int startid,int endid)
{
var result = (from text in context.Text
where text.id >= startid && text .id <=endid
select text).ToList<Text>();
return result;
}
[WebMethod]
public List<Text> selectAll()
{
return context.Text.ToList<Text>();
}
/// <summary>
/// Ìí¼ÓÒ»¸öÊý¾Ý
/// </summary>
/// <param name="sex">ÐÔ±ð</param>
/// <param name="age">ÄêÁä</param>
/// <returns>³É¹¦ÎªTrue·ñÔòΪFalse</returns>
[WebMethod]
public List<Text> addText(string sex, int age)
{
Te
Ïà¹ØÎĵµ£º
ÈóǬ±¨±í¿ÉÒÔͨ¹ýSQL¼ìË÷ºÍ¸´ÔÓSQLÉú³ÉÊý¾Ý¼¯¡£µ±SQLÖÐÐèÒª´«Èë¶à¸ö²ÎÊýʱ£¬ÒªÔÚÉè¼ÆÆ÷ÖÐͨ¹ý ÅäÖÃ-²ÎÊý ¶¨ÒåÏàÓ¦µÄ²ÎÊý£¬È»ºóÔÙ°ÑSQLÖÐÐèÒª²ÎÊýµÄµØ·½Ìæ»»³É?£¬×îºó»¹ÒªÔÚSQL±à¼Æ÷ÖÐÌí¼Ó¶ÔÓ¦?µÄ²ÎÊý¡£ÕâÑùµ±SQLÖÐÓжàÉÙ¸öÎʺţ¬ÎÒÃǾÍÐèÒªÌí¼Ó¶àÉÙ¸ö²ÎÊý¡£µ±SQLÖÐÓõ½µÄ²ÎÊý±È½ÏÉÙʱ£¬²Ù×÷ÆðÀ´»¹±È½Ï·½±ã¡£µ«µ±ÒµÎñ±È½Ï¸´ ......
SQLÓïÑÔ¿ìËÙÈëÃÅ
ä½ Ïª ɳ
Àî璟
ÊÖ¾íÕæÖéÉÏÓñ¹³,ÒÀǰ´ººÞËøÖØÂ¥, ·çÀïÂ仨ËÊÇÖ÷, Ë¼ÓÆÓÆ
ÇàÄñ²»´«ÔÆÍâÐÅ,¶¡Ïã¿Õ½áÓêÖгî, »ØÊ×Â̲¨Èý³þĺ, ½ÓÌìÁ÷
SQLÓïÑÔ¿ìËÙÈëÃÅ
SQLÊÇÓ¢ÎÄStructured Query LanguageµÄËõд£¬Òâ˼Ϊ½á¹¹»¯²éѯÓïÑÔ¡£SQLÓïÑÔµÄÖ÷Òª¹¦ÄܾÍÊÇͬ¸÷ÖÖÊý¾Ý¿â½¨Á¢ÁªÏµ£¬½øÐйµÍ¨¡£°´ÕÕA ......
ת×Ôhttp://lavasoft.blog.51cto.com/62575/23373
SQLÓïÑÔµÄCASEÓï¾ä±¸Íü
¸ÅÊö£º
SQLÓï¾äÖеÄCASEÓï¾äÓë¸ß¼¶ÓïÑÔÖеÄswitchÓï¾ä£¬ÊDZê×¼SQLµÄÓï·¨£¬ÊÊÓÃÓëÒ»¸öÌõ¼þÅжÏÓжàÖÖÖµµÄÇé¿öÏ·ֱðÖ´Ðв»Í¬µÄ²Ù×÷¡£Áé»îÓ¦ÓÃCASEÓï¾ä¿ÉÒÔʹSQLÓï¾ä±äµÃ¼ò½àÒ×¶Á£¬ÏÂÃæÔÚDB2»·¾³ÏÂͨ¹ýÒ»¸ö¼òµ¥µÄ²éѯÀ´Õ¹Ê¾SQL CASEÓ ......