Windows Mobile 6.0Á¬½ÓSQL Server 2005(PC°æ)
»·¾³´î½¨£º
windows MobileµÄ¿ª·¢»·¾³µÄ´î½¨ÕâÀï¾Í²»ËµÁË£¬²»Ã÷°×µÄÅóÓÑÔÚÍøÉÏËÑϼ´¿É¡£
²½Öè¸ÅÊö:
1£ºPCÉϵÄSQL SERVER ÐèÒª¿ªÆôÔ¶³ÌÁ¬½Ó¡£
2£ºMoblieÄ£ÄâÆ÷ÐèҪͨ¹ýActiveSyncÁ¬½Ó£¬Ê¹ÆäÄܹ»Í¨¹ýPCÁ¬Íø¡£(Èç¹ûÊÇÊÖ»úµÄ»°£¬ÐèÒªÄܹ»Í¨¹ýÎÞÏßÍøÂçÁ¬È뻥ÁªÍø)
Ïêϸ˵Ã÷£º
1:SQL Server 2005¿ªÆôÔ¶³ÌÁ¬½Ó¡£
1£©.“¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server ÍâΧӦÓÃÅäÖÃÆ÷”
2£©.ÔÚ“SQL Server 2005 ÍâΧӦÓÃÅäÖÃÆ÷”Ò³, µ¥»÷“·þÎñºÍÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷”
3£©.È»ºóµ¥»÷Õ¹¿ª“Êý¾Ý¿âÒýÇ攣¬ Ñ¡ÖГԶ³ÌÁ¬½Ó”£¬ÔÚÓÒ±ßÑ¡ÖГ±¾µØÁ¬½ÓºÍÔ¶³ÌÁ¬½Ó”£¬
ÔÙÑ¡ÔñҪʹÓõÄÐÒ飬µ¥»÷“Ó¦ÓÔ£¬Äú»á¿´µ½ÏÂÏûÏ¢£º
“Ö±µ½ÖØÐÂÆô¶¯Êý¾Ý¿âÒýÇæ·þÎñºó£¬¶ÔÁ¬½ÓÉèÖÃËù×öµÄ¸ü¸Ä²Å»áÉúЧ¡£”£¬µ¥»÷“È·¶¨”°´Å¥·µ»Ø
4£©.Õ¹¿ª“Êý¾Ý¿âÒýÇ攣¬ Ñ¡ÖГ·þÎñ”£¬ÔÚÓұߵ¥»÷“Í£Ö¹”£¬µÈµ½ MSSQLSERVER ·þÎñÍ£Ö¹£¬
È»ºóµ¥»÷“Æô¶¯”£¬ÖØÐÂÆô¶¯MSSQLSERVER ·þÎñ¡£
2£ºÊ¹windows MobileÄ£ÄâÆ÷ͨ¹ýPCÉÏÍø
MoblieÄ£ÄâÆ÷ÔÚVS2008ÀïÒѾ´æÔÚ£¬²»ÐèÒªÏÂÔØ
1£© VS 2008->¹¤¾ß->·ÂÕæÉ豸¹ÜÀíÆ÷
2£©´ò¿ªºó¼´¿É¿´µ½Ä£ÄâÆ÷£¬Ñ¡ÔñÄãҪģÄâµÄÉ豸£¬ÓÒ¼üµ¥»÷£¬ÔÙµã»÷ Á¬½Ó£¬È»ºó´ò¿ªActiveSync,
ActiveSyncµÄÅäÖÃÈçͼ
ÅäÖÃÍê³Éºó ÔÚÉ豸ģÄâÆ÷ÖÐÑ¡ÔñÄãÄ£ÄâµÄÉ豸£¬ÓÒ¼üµ¥»÷ºóÑ¡Ôñ ²åÈëµ××ù£¬ÕâʱÄãµÄÄ£ÄâÆ÷¼´¿ÉÉÏÍø¡£
3£©²âÊÔ´úÂë
//Ìí¼ÓÃüÃû¿Õ¼ä
using System.Data.Common;
using System.Data.SqlClient;
//×¢ÒâÕâÀïÓõIJ»ÊÇSqlServerCe;ÏÂÃæµÄÒ²ÊÇÓõÄAdo.netµÄPC°æ£¬²»ÊÇCe°æ¡£
private void ConnetToSQLTest()
{
//Data Source:IP+¶Ë¿ÚºÅ ÆäËûµÄºÍpcÉϵÄÒ»ÖÂ
string connectionString = "Data Source=192.168.0.105,1433;Initial Catalog=wjnTest;User Id=sa;Password=123";
using (SqlConnection ceconn = new SqlConnection(connectionString))
{
ceconn.Open();
SqlCommand cmd = new SqlCommand("insert into Users(username,passwd)values('test','123')", ceconn);
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
Ò». ²éÕÒÖظ´¼Ç¼
1. ²éÕÒÈ«²¿Öظ´¼Ç¼
Select * from ±í Where Öظ´×ֶΠIn (Select Öظ´×Ö¶Î
from ±í Group By Öظ´×ֶΠHaving Count(*)>1)
2. ¹ýÂËÖظ´¼Ç¼(Ö»ÏÔʾһÌõ)
Select * from HZT Where ID In (Select Max(ID) from HZT Group By Title)
×¢£º´Ë´¦ÏÔʾID×î´óÒ»Ìõ¼Ç¼
¶þ. ɾ³ýÖظ´¼Ç ......
¹¦ÄÜ£º·µ»Ø×Ö·û¡¢¶þ½øÖÆ¡¢Îı¾»òͼÏñ±í´ïʽµÄÒ»²¿·Ö
Óï·¨£ºSUBSTRING ( expression, start, length )
SQL ÖÐµÄ substring º¯ÊýÊÇÓÃÀ´×¥³öÒ»¸öÀ¸Î»×ÊÁÏÖеÄÆäÖÐÒ»²¿·Ö¡£Õâ¸öº¯ÊýµÄÃû³ÆÔÚ²»Í¬µÄ×ÊÁÏ¿âÖв»ÍêÈ«Ò»Ñù£º
²ÎÊý£º
expression ×Ö·û´®¡¢¶þ½øÖÆ×Ö·û´®¡¢Î ......
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµÄËùÓÐѧÉúµÄѧºÅ£»
select a.S# from (select s#,score from SC where C#='001') a,(select s#,score
fr ......
Ö÷ÒªÕë¶ÔSQL ServerÊý¾Ý¿âËÀËøÏÖÏóµÄÔ¤·À¼°½â¾ö´ëÊ©½øÐÐÁËÏêϸµÄ½éÉÜ£¬¸ü¶àÄÚÈÝÇë´ó¼Ò²Î¿¼ÏÂÎÄ£º
¡¡¡¡ËÀËøÊÇÖ¸ÔÚij×é×ÊÔ´ÖУ¬Á½¸ö»òÁ½¸öÒÔÉϵÄÏß³ÌÔÚÖ´Ðйý³ÌÖУ¬ÔÚÕù¶áijһ×ÊԴʱ¶øÔì³É»¥ÏàµÈ´ýµÄÏÖÏó£¬ÈôÎÞÍâÁ¦µÄ×÷ÓÃÏÂ,ËüÃǶ¼½«ÎÞ·¨ÍƽøÏÂÈ¥£¬ËÀʱ¾Í¿ÉÄÜ»á²úÉúËÀËø,ÕâЩÓÀÔ¶ÔÚ»¥ÏàµÈ´ýµÄ½ø³Ì³ÆΪËÀËøÏ̡߳£¼òµ¥µ ......