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

SQL ͨÓô洢¹ý³Ì


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// <summary>
/// CommonProc µÄժҪ˵Ã÷
/// </summary>
public class CommonProc
{
public CommonProc()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼­
//
}

public static DataSet CommonProcSel(string procname, params object[] obj)
{
using (SqlConnection sqlcon = new SqlConnection("server=SAMSUNG-B76C7F0;database=ASPNETDB;uid=sa;pwd=sasa;"))
{
sqlcon.Open();
SqlCommand sqlcmd = new SqlCommand();
sqlcmd.Connection = sqlcon;
sqlcmd.CommandType = CommandType.StoredProcedure;
sqlcmd.CommandText = procname;


SqlCommandBuilder.DeriveParameters(sqlcmd);
sqlcmd.Parameters.RemoveAt(0);

for (int i = 0; i < sqlcmd.Parameters.Count; i++)
{
sqlcmd.Parameters[i].Value = obj[i];
}

SqlDataAdapter sqldap = new SqlDataAdapter();
sqldap.SelectCommand = sqlcmd;

DataSet ds = new DataSet();
sqldap.Fill(ds);

return ds;

}
}

public static bool CommonProcTSG(string procname, params object[] obj)
{
using (SqlConnection sqlcon = new SqlConnection("server=SAMSUNG-B76C7F0;database=ASPNETDB;uid=sa;pwd=sasa;"))
{
sqlcon.Open();
SqlCommand sqlcmd = new SqlCommand();
sqlcmd.CommandType = CommandType.StoredProcedure;
sqlcmd.CommandText = procname;
sqlcmd.Connection = sqlcon;

SqlCommandBuilder.DeriveParameters(sqlcmd);
sqlcmd.Parameters.RemoveAt(0);



Ïà¹ØÎĵµ£º

ÔõÑù¶ÔSQL Server 2005¼ÓÃܵĴ洢¹ý³Ì½øÐнâÃÜ

 SQLServer2005ÀïʹÓÃwith encryptionÑ¡Ïî´´½¨µÄ´æ´¢¹ý³ÌÈÔÈ»ºÍsqlserver2000ÀïÒ»Ñù£¬¶¼ÊÇʹÓÃXOR½øÐÐÁ˵ļÓÃÜ¡£ºÍ2000²»Ò»ÑùµÄÊÇ£¬ÔÚ2005µÄϵͳ ±ísyscommentsÀïÒѾ­²é²»µ½¼ÓÃܹýµÄÃÜÎÄÁË¡£Òª²éÃÜÎıØÐëʹÓÃDAC(רÓùÜÀíÔ±Á¬½Ó)Á¬½Óµ½Êý¾Ý¿âºó£¬ÔÚϵͳ±í sys.sysobjvalues²éѯ£¬¸Ã±íµÄÁÐimageval´æ´¢ÁËÏàÓ¦µÄÃÜÎÄ¡£¾ß ......

SQLÖÐonÌõ¼þÓëwhereÌõ¼þµÄÇø±ð (having)

 
 
SQLÖÐonÌõ¼þÓëwhereÌõ¼þµÄÇø±ð
      Êý¾Ý¿âÔÚͨ¹ýÁ¬½ÓÁ½ÕÅ»ò¶àÕűíÀ´·µ»Ø¼Ç¼ʱ£¬¶¼»áÉú³ÉÒ»ÕÅÖмäµÄÁÙʱ±í£¬È»ºóÔÙ½«ÕâÕÅÁÙʱ±í·µ»Ø¸øÓû§¡£
     ÔÚʹÓÃleft jionʱ£¬onºÍwhereÌõ¼þµÄÇø±ðÈçÏ£º
1¡¢ onÌõ¼þÊÇÔÚÉú³ÉÁÙʱ±íʱʹÓõÄÌõ¼ ......

SQL×¢Èë

Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊ ......

fastreport´òÓ¡´úÂë¼°SQLºÏ²¢×ֶεÄÓï¾ä

 procedure Tform1.Button5Click(Sender: TObject);
var
  p:pointer;
  FrfStr:string;
begin
  inherited;
  Screen.Cursor:=MYCURSORWAITHAND;
  with cdsPrint do
  begin
    Active:=false;
    //Õâ¸öSQLÓÃÓÚ½«remarkÖеļǼºÏ²¢µ½Ò»Æ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ