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

delphi_sql_Óαê·ÖÒ³_·ÖÒ³dbgrid²éѯ

alter procedure qry_page
  @sqlstr nvarchar(4000),     --²éѯ×Ö·û´®
  @page int,                  --µÚNÒ³
  @pagesize int               --ÿҳÐÐÊý
as
  declare @rscounts int       --¼Ç¼×ÜÊý
  declare @pages int          --Ò³Ãæ×ÜÊý
  set nocount on
  declare @P1 int --P1ÊÇÓαêµÄid
  exec sp_cursoropen @P1 output,@sqlstr,@scrollopt=1,@ccopt=1,@RecordCount=@rscounts output
  set @pages = ceiling(1.0*@rscounts/@pagesize)
  if @page<=0 set @page=1
  if @page>@pages set @page=@pages
  --µ±Ç°Ò³ÃæÌõÊý£¬²»×ãÒ»Ò³
  declare @curpg_counts int  
  if @rscounts<@page*@pagesize
    set @curpg_counts=@rscounts-(@page-1)*@pagesize
  else
    set @curpg_counts=@pagesize
  --µ±Ç°Ò³ÆðʼÐÐ,´Ó1¿ªÊ¼
  declare @startPos int  
  set @startPos=(@page-1)*@pagesize+1
  --»ñȡָ¶¨¼Ç¼
  exec sp_cursorfetch @P1,16,@startPos,@curpg_counts
  exec sp_cursorclose @P1
  set nocount off
  --ÁíÍâ·µ»Ø¼Ç¼×ÜÊý/×ÜÒ³ÃæÊý/µ±Ç°Ò³/ÿҳÌõÊý
  select rscounts=@rscounts,pages=@pages,pagesize=@pagesize,page=@page
--exec qry_page 'select * from user_record_in order by id',3,5
¿Í»§¶Ë·ÃÎʳÌÐò
delphi°æ±¾:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Grids, DBGrids, ExtCtrls, DB, ADODB, Mask;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    SpeedButton6: TSpeedButton;
    SpeedButton7: TSpeedButton;
    Label5: TLabel;
    SpeedButton1: TSpeedButt


Ïà¹ØÎĵµ£º

jnativeµ÷ÓÃdelphiµÄDLLÎļþ

1.ÏÂÔØJNativeµÄ°ü
JNative-1.3.2ÏÂÓÐÈý¸öÎļþ£ºJNativeCpp.dll£¬libJNativeCpp.so£¬JNative.jar¡£
JNativeCpp.dll¿½µ½windows/system32Ŀ¼ÏÂ
libJNativeCpp.soΪLinuxÖÐʹÓõÄÎļþ
JNative.jarÀ©Õ¹°ü¿½µ½%JAVA_HOME%\jre\lib\extÏ»òÕßµ¼Èëµ½¹¤³ÌÖÐ
2.JnativeÖÐʹÓõ½µÄһЩÀàºÍ·½·¨
org
.xvolks
.jnative
.Jnat ......

SQL×¢ÈëÕûÀí

£Ó£Ñ£Ì×¢ÈëÊÇ´ÓÕý³£µÄWWW¶Ë¿Ú·ÃÎÊ£¬¶øÇÒ±íÃæ¿´ÆðÀ´¸úÒ»°ãµÄWebÒ³Ãæ·ÃÎÊÃ»Ê²Ã´Çø±ð£¬ ËùÒÔĿǰÊÐÃæµÄ·À»ðǽ¶¼²»»á¶Ô£Ó£Ñ£Ì×¢Èë·¢³ö¾¯±¨£¬Èç¹û¹ÜÀíԱû²é¿´IISÈÕÖ¾µÄϰ¹ß£¬¿ÉÄܱ»ÈëÇֺܳ¤Ê±¼ä¶¼²»»á·¢¾õ¡£
Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µ ......

sqlÓï¾ä¼¯ºÏ

A¡£
SQLÓï¾äµÄ²¢¼¯UNION£¬½»¼¯JOIN(ÄÚÁ¬½Ó£¬ÍâÁ¬½Ó)£¬½»²æÁ¬½Ó(CROSS
JOINµÑ¿¨¶û»ý)£¬²î¼¯(NOT IN)
1.
a. ²¢¼¯UNION
SELECT column1, column2 from table1
UNION
SELECT column1, column2 from table2
b. ½»¼¯JOIN
SELECT * from table1 AS a JOIN table2 b ON a.name=b.name
c. ²î¼¯NOT IN
SELECT * from tabl ......

linq to sql ÖеÄin ²Ù×÷ʵÏÖ


        string s = " 80,81,83,82";
        string[] s1 = s.Split(',');
        int[] p = new int[s1.Count()];
        for (int i = 0; i < s1.Count( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ