Linq²éѯ DataSet ÄÜ·ñºÍSQL ¼¶Áª£¿
×î½ü×öÏîÄ¿µÄʱºò£¬Óöµ½ÁËÒ»¸öÎÊÌâ¡£ÎÒÖ÷ÒªÊÇ×öÒ»¸öWeb Services¸ø±ðÈËÓõġ£±ðÈË´«Ò»¸öÓû§IDºÅ¹ýÀ´£¬È»ºóÎÒ½«Õâ¸öÓû§µÄËùÓкÃÓѵÄÏÂÔؼǼ°ü×°³ÉÒ»¸öDataSet·µ»ØÈ¥¡£ ¶ø¸ù¾ÝÓû§IDºÅ»ñÈ¡¸ÃÓû§µÄËùÓкÃÓÑÐÅÏ¢£¬ÔòÊÇͨ¹ýÁíÒ»¸öWeb ServicesµÃµ½µÄ£¬ÕâÀïΪFriendDS¡£
ÎÒÔ±¾µÄÏë·¨ÊÇ£º½«Õâ¸öFriendDS ÓëÊý¾Ý¿â¼¶Áª²éѯ£¬´úÂëÈçÏ£º
var linq = from t1 in mycon.Templet_Down
join t2 in mycon.Templet
on t1.TempletID equals t2.TempletID
join t3 in FriendDS.Tables[0].AsEnumerable()
on t1.UserID equals t3.Field< System.Guid >("FriendID")
select new
{
UserID = userID,
FriendID = t3.Field< System.Guid >("FriendID"),
FriendName = t3.Field < System.String >("FriendName"),
TempletName = t2.TempletName,
&nbs
Ïà¹ØÎĵµ£º
ÎÊÌâÌá³ö:
ÔÚÓ¦ÓóÌÐòÖо³£ÐèÒª²éѯÊý¾Ý¡£µ±²éѯ½á¹ûÊý¾ÝÁ¿±È½Ï´óµÄʱºò£¬¼ìË÷½á¹û¡¢½çÃæÏÔʾ¶¼ÐèÒª»¨·Ñ´óÁ¿µÄʱ¼ä¡£ÎªÁ˱ÜÃâÕâ¸öÎÊÌ⣬Ӧ¸Ãÿ´ÎÖ»¼ìË÷²¿·ÖÊý¾Ý£¬Ò²¾ÍÊÇʹÓó£¼ûµÄ·ÖÒ³·½Ê½À´´¦Àí¡£·ÖÒ³µÄÎÊÌâÔÚasp.netÖкÃÏñ·Ç³£¼òµ¥£¬Ö»ÒªÔÚGridViewÖÐÆôÓ÷ÖÒ³¾Í¿ÉÒÔÁË¡£ÆôÓ÷ÖÒ³ºó£¬GridView¹ØÁªÊý¾ÝÔ´¿Ø¼þ£¬ÒÀ¾É»á¼ÓÔØ ......
1.Union
UNION Ö¸ÁîµÄÄ¿µÄÊǽ«Á½¸ö SQL Óï¾äµÄ½á¹ûºÏ²¢ÆðÀ´¡£´ÓÕâ¸ö½Ç¶ÈÀ´¿´£¬ UNION ¸ú JOIN ÓÐЩÐíÀàËÆ£¬ÒòΪÕâÁ½¸öÖ¸Á¿ÉÒÔÓɶà¸ö±í¸ñÖÐߢȡ×ÊÁÏ¡£ UNION µÄÒ»¸öÏÞÖÆÊÇÁ½¸ö SQL Óï¾äËù²úÉúµÄÀ¸Î»ÐèÒªÊÇͬÑùµÄ×ÊÁÏÖÖÀà¡£ÁíÍ⣬µ±ÎÒÃÇÓà UNIONÕâ¸öÖ¸Áîʱ£¬ÎÒÃÇÖ»»á¿´µ½²»Í¬µÄ×ÊÁÏÖµ (ÀàËÆ SELECT DISTINCT)¡£
UNION µ ......
BackupEveryDay
ÿÌì½øÐÐÊý¾Ý¿âµÄ²îÒ챸·Ý
day
Declare @File Varchar(2000)
Set @File='E:\Databasebackup\njyc_data_diff.BAK'
Backup database njyc_data to Disk=@File with DIFFERENTIAL
WeekBackup
ÿÖܽøÐÐÒ»´ÎÊý¾Ý¿âµÄÍêÈ«±¸·Ý£¬±¸·ÝÎļþÃûΪµ±ÌìÈÕÆÚ £¨njyc_data_Äê_ÔÂ_ÈÕ£©
BackupAll
DECLARE @BackupFi ......
¾µäSQLÓï¾ä´óÈ«
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢Ë ......
select f.AGENTID as 'ID',
f.AGENTNAME as 'ÐÕÃû',
f.COMNAME as '¹«Ë¾¼ò³Æ',
c.REGISTDATE as '×¢²áʱ¼ä',
......