ÓÐЩ³£¼ûµÄÎÊÌâÔÚÂÛ̳Öв»¶Ï³öÏÖ£¬²»·ÁÕûÀíһϡ£
ÒÔÏÂÓï¾äÊÇÔÚSQLServer2005ÉÏʵÏֵģ¬Ò»Ð©Óï¾äÎÞ·¨ÔÚSS2000ÉÏÖ´ÐС£
ÓÐÓÃÖ¸ÊýÊÇÎÒ¸ù¾ÝÕâ¸öÎÊÌâµÄ³£¼û³Ì¶È´òµÄ·Ö£¬½ö¹©²Î¿¼¡£Êµ¼ÊÉÏ£¬µ±ÄãÓöµ½ÁËÕâ¸öÎÊÌ⣬Õâ¸öÎÊÌâÄÄÅÂÔÙÉÙ¼û£¬½â¾ö·½°¸Ò²ÊǷdz£ÓÐÓõġ£
1. Éú³ÉÈô¸ÉÐмǼ
ÓÐÓÃÖ¸Êý£º¡ï¡ï¡ï¡ï¡ï
³£¼ûµÄÎÊÌâÀàÐÍ£º¸ù¾ÝÆðÖ¹ÈÕÆÚÉú³ÉÈô¸É¸öÈÕÆÚ¡¢Éú³ÉÒ»ÌìÖеĸ÷¸öʱ¼ä¶Î
¡¶SQL Server 2005¼¼ÊõÄÚÄ»£ºT-SQL²éѯ¡·×÷Õß½¨ÒéÔÚÊý¾Ý¿âÖд´½¨Ò»¸öÊý¾Ý±í£º
SQL code
--×ÔÈ»Êý±í1-1M
CREATE TABLE Nums(n int NOT NULL PRIMARY KEY CLUSTERED)
--ÊéÉϽéÉÜÁ˺ܶàÖÖÌî³ä·½·¨£¬ÒÔÏÂÊÇ×î¸ßЧµÄÒ»ÖÖ£¬ÐèÒªSS2005µÄROW_NUMBER()º¯Êý¡£
WITH B1 AS(SELECT n=1 UNION ALL SELECT n=1), --2
B2 AS(SELECT n=1 from B1 a CROSS JOIN B1 b), --4
B3 AS(SELECT n=1 from B2 a CROSS JOIN B2 b), --16
B4 AS(SELECT n=1 from B3 a CROSS JOIN B3 b), --256
B5 AS(SELECT n=1 from B4 a CROSS JOIN B4 b), --65536
CTE AS(SELECT r=ROW_NUMBER() OVER(ORDER BY (SELECT 1)) from B5 a CROSS JOIN B3 b) --65536 * 16
INSERT INTO Nums(n)
SELECT TOP(1000000) r from CTE ORDER BY ......
¼Ç¼һÏÂÒÔ±¸Ï´οìËÙÕÒµ½¡£¡£¡£
Íùtb_wf_privgrant±íÖвåÈëÒ»Ìõ¼Ç¼£¬workflow_id×Ö¶ÎÖµ´Ótb_wf_workflow ±íÖлñÈ¡workflow_name='֪ʶÉóºË'µÄËùÓмǼÖÐworkflow_id×î´óÖµ¡£
--oracle
declare a NUMBER(10);
begin
select max(workflow_id) into a from tb_wf_workflow where workflow_name='֪ʶÉóºË';
insert into tb_wf_privgrant(grant_Id,workflow_id,member_id,member_type,knowledge_code) values (HIBERNATE_SEQUENCE.NEXTVAL, a,'r001','R','6001');
end;
--sqlserver
--·½·¨Ò»
insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowledge_code)
select max(workflow_id),'r001','R','6001' from tb_wf_workflow where workflow_name='֪ʶÉóºË'
--·½·¨¶þ
declare @a numeric(10,0)
select @a = max(workflow_id) from tb_wf_workflow where workflow_name='֪ʶÉóºË'
insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowl ......
¼Ç¼һÏÂÒÔ±¸Ï´οìËÙÕÒµ½¡£¡£¡£
Íùtb_wf_privgrant±íÖвåÈëÒ»Ìõ¼Ç¼£¬workflow_id×Ö¶ÎÖµ´Ótb_wf_workflow ±íÖлñÈ¡workflow_name='֪ʶÉóºË'µÄËùÓмǼÖÐworkflow_id×î´óÖµ¡£
--oracle
declare a NUMBER(10);
begin
select max(workflow_id) into a from tb_wf_workflow where workflow_name='֪ʶÉóºË';
insert into tb_wf_privgrant(grant_Id,workflow_id,member_id,member_type,knowledge_code) values (HIBERNATE_SEQUENCE.NEXTVAL, a,'r001','R','6001');
end;
--sqlserver
--·½·¨Ò»
insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowledge_code)
select max(workflow_id),'r001','R','6001' from tb_wf_workflow where workflow_name='֪ʶÉóºË'
--·½·¨¶þ
declare @a numeric(10,0)
select @a = max(workflow_id) from tb_wf_workflow where workflow_name='֪ʶÉóºË'
insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowl ......
µ±ÔÚC#ÓïÑÔÖУ¬Á¬½ÓsqlÊý¾Ý¿âµÄʱºò£¬³£Óõ½sqlconnection½¨Á¢ÓëÊý¾Ý¿âµÄÁ¬½Ó¡£ Óï·¨ÈçÏ£º
String sqlcon = "***";//ÕâÀïÊÇÒ»¸ö×Ö·û´®£¬¾ßÌå¸úÊý¾Ý¿âµÄÑéÖ¤·½Ê½Óйء£
//sql server Éí·ÝÑéÖ¤ Á¬½Ó×Ö·û´®
private string ConnstrSqlServer = "server=·þÎñÆ÷Ãû³Æ;uid=µÇ¼Ãû³Æ;pwd=µÇ¼ÃÜÂë;database=Êý¾Ý¿âÃû³Æ";
//windows Éí·ÝÑéÖ¤Á¬½Ó×Ö·û´®
private string ConnstrWindows = "server=·þÎñÆ÷Ãû³Æ;database=Êý¾Ý¿âÃû³Æ;Trusted_Connection=SSPI";
SqlConnection connection = new SqlConnection(sqlcon);
ÀýÈ磺
SqlConnection connection = new SqlConnection("server=(local);database=dotNET_lab;Trusted_Connection=SSPI");
//windowsÑéÖ¤·½Ê½ ¡£
SqlConnection connection = new SqlConnection("server=(local);uid=sa;password=sa;database=dotNET_lab");
//»ìºÏÑéÖ¤·½Ê½ ¡£
È»ºó£¬
try {
connection.Open();
......
µ±ÔÚC#ÓïÑÔÖУ¬Á¬½ÓsqlÊý¾Ý¿âµÄʱºò£¬³£Óõ½sqlconnection½¨Á¢ÓëÊý¾Ý¿âµÄÁ¬½Ó¡£ Óï·¨ÈçÏ£º
String sqlcon = "***";//ÕâÀïÊÇÒ»¸ö×Ö·û´®£¬¾ßÌå¸úÊý¾Ý¿âµÄÑéÖ¤·½Ê½Óйء£
//sql server Éí·ÝÑéÖ¤ Á¬½Ó×Ö·û´®
private string ConnstrSqlServer = "server=·þÎñÆ÷Ãû³Æ;uid=µÇ¼Ãû³Æ;pwd=µÇ¼ÃÜÂë;database=Êý¾Ý¿âÃû³Æ";
//windows Éí·ÝÑéÖ¤Á¬½Ó×Ö·û´®
private string ConnstrWindows = "server=·þÎñÆ÷Ãû³Æ;database=Êý¾Ý¿âÃû³Æ;Trusted_Connection=SSPI";
SqlConnection connection = new SqlConnection(sqlcon);
ÀýÈ磺
SqlConnection connection = new SqlConnection("server=(local);database=dotNET_lab;Trusted_Connection=SSPI");
//windowsÑéÖ¤·½Ê½ ¡£
SqlConnection connection = new SqlConnection("server=(local);uid=sa;password=sa;database=dotNET_lab");
//»ìºÏÑéÖ¤·½Ê½ ¡£
È»ºó£¬
try {
connection.Open();
......
Ò»ÌáÆð»ùÓÚWeb Services¼¼ÊõµÄÓ¦ÓóÌÐò¿ª·¢£¬Ò»°ãÈËÊ×ÏÈÏëµ½µÄ¿ª·¢¹¤¾ßÊÇVs.net£¬Æäʵ×÷Ϊ¿ìËÙÓ¦ÓóÌÐò¿ª·¢¹¤¾ß(RAD)µÄÀÏ´ó£¬Delphi´Ó6.0¾Í¿ªÊ¼Ö§³ÖWeb ServicesµÄ¿ª·¢ºÍÓ¦ÓÃÁË£¬±¾ÎÄͨ¹ýʹÓÃDelphi 7.0µ÷ÓÃÐÂÀË·¢ËͶÌÐŵÄWeb Service½øÐжÌÐÅÓ¦ÓóÌÐò¿ª·¢ÕâһʵÀýÏêϸµÄ½éÉÜÔÚDelphiÖÐÈçºÎ¿ª·¢»ùÓÚWeb ServicesµÄÓ¦ÓÃϵͳ¡£
µÚÒ»²½£¬×¼±¸¹¤×÷£¬Á˽âÐÂÀ˶ÌÐÅWeb Service¡£ÐÂÀË·¢ËͶÌÐŵÄWeb ServiceµØÖ·ÊÇhttp://smsinter.sina.com.cn/ws/smswebservice0101.wsdl£¬¸ÃWeb Service¾ÍÖ»ÓÐÒ»¸ö·½·¨£¬¼´string sendXml(carrier,userid,password,mobilenumber,content,msgtype)¡£¸÷¸ö²ÎÊýÈ«²¿ÎªstringÀàÐÍ£¬Æ京Òå»ù±¾ÈçÏ£¨¿ÉÄܲ»ÕýÈ·£©¡£
Carrier£ºÔËÓªÉÌÃû³Æ£¬ºÃÏñ¿ÉÒÔËæ±ãÊ䣬½¨ÒéÊäÈë“Sina”£¬Èç¹ûÊäÈëÆäËûµÄÖµ£¬ÏûÏ¢·¢Ë͵ÄÌرðÂý£»
Userid£ºÄúÔÚÐÂÀËÎÞÏßÉÏ×¢²áµÄÊÖ»úID£¬Èç¹ûÄúûÓÐÔÚhttp://sms.sina.com.cnÉÏ×¢²áÄúµÄÊÖ»ú£¬ÄãÊÇÎÞ·¨Ê¹Óñ¾Web Service·¢ËͶÌÐŵģ»
Password£ºÄúÔÚÐÂÀËÎÞÏßÉÏ×¢²áÊÖ»úʱËùʹÓõÄÃÜÂ룻
Mobilenumber£º¶Ô·½µÄÊÖ»úºÅÂ룻
Content£º·¢ËͶÌÏûÏ¢µÄÄÚÈÝ£»
Msgtype£º·¢ËͶÌÏûÏ¢µÄÀàÐÍ£¬ÎÒ¹À¼ÆÖ§³Ö²ÊÐÅ£¬²»¹ýÎÒ²»ÖªµÀÔõôʹÓã¬ËƺõË ......
ÉèÓÐÒÔÏÂÈý¸ö±äÁ¿£º
var
s:string;
p:pchar;
a:array[1..20] of char;
ÄÇôÈýÕßÖ®¼äµÄת»»ÈçÏ£º
1¡¢×Ö·û´®µ½PChar
p:=PChar(s);
2¡¢PCharµ½×Ö·û´®
s:=p;
3¡¢PCharµ½×Ö·ûÊý×é
StrCopy(@a,p);
4¡¢×Ö·ûÊý×éµ½PChar
PChar(@a);
5¡¢×Ö·û´®Óë×Ö·ûÊý×éÖ®¼äµÄת»»¾ÍÖ»ÓÐͨ¹ýPCharÀ´ÖÐתÁË¡£ÀýÈçÏÂÃæÕâ¸öÀý×Ó£º
procedure TForm1.btn1Click(Sender: TObject);
var
str:array[1..10] of char;
begin
StrCopy(@str,PChar(mmo1.Text));
mmo2.Text:=PChar(@str);
end;
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/Aricc/archive/2006/11/06/1368984.aspx ......
delphiÖÐSynchronizeÕâ¸ö¶«¶«ÓÐʲôÓã¿ÎÒÖªµÀÊÇÏß³Ìͬ²½Ê¹ÓõÄ
ÊÇ·ñÊÇÒ»¸öº¯Êý»ò±äÁ¿£¬µ±Ò»¸öÏß³ÌÔÚʹÓÃʱ£¬Èç¹ûÕâ¸öº¯ÊýʹÓÃÁËSynchronizeÐÞîߵĻ°¾Í²»ÔÊÐí±ðÒ»¸öÏß³ÌÀ´µ÷ÓÃÕâ¸öº¯Êý
1Â¥£º±ðµÄÏ̻߳áµÈ´ý¸Ã²Ù×÷Íê³Éºó²ÅÄܼÌÐø
2Â¥£ºÄã˵µÄ»ù±¾ÊÇÕâ¸öÒâ˼¡£ËüµÄÄ¿µÄÊDZÜÃâ¶à¸ö×ÓÏß³Ìͬʱ·ÃÎÊÖ÷Ïß³Ì×ÊÔ´¡£
ʾÀý£º
procedure ServerThread.ListItemEnd; //×ÓÏ̵߳ÄÒ»¸ö·½·¨
begin
if (ListItem <> nil) then
ListItem.SubItems.Strings[3] := '´«ËÍÍê±Ï'; //ListItemÊÇÖ÷Ï̵߳ÄÒ»¸öTreeViewµÄÒ»ÐÐ
end;
procedure ServerThread.ClientExecute; //×ÓÏß³ÌÖ´ÐÐ
begin
Synchronize(ListItemEnd);
//Èç¹ûÖ±½ÓдListItemEnd£¬¿ÉÄÜ·¢Éú³åÍ»¡£
end;
—————————————————————————————————
MaximStr := '³èÈè²»¾ª£¬¿´Í¥Ç°»¨¿ª»¨Â䣬ȥÁôÎÞÒ⣻
»ÙÓþÓÉÈË£¬ÍûÌìÉÏÔƾíÔÆÊ棬¾ÛÉ¢Èη硣';
if Not Assigned(I) then
I := TI.Create(Nil ......