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);
Ïà¹ØÎĵµ£º
SQLServer2005ÀïʹÓÃwith encryptionÑ¡Ïî´´½¨µÄ´æ´¢¹ý³ÌÈÔÈ»ºÍsqlserver2000ÀïÒ»Ñù£¬¶¼ÊÇʹÓÃXOR½øÐÐÁ˵ļÓÃÜ¡£ºÍ2000²»Ò»ÑùµÄÊÇ£¬ÔÚ2005µÄϵͳ ±ísyscommentsÀïÒѾ²é²»µ½¼ÓÃܹýµÄÃÜÎÄÁË¡£Òª²éÃÜÎıØÐëʹÓÃDAC(רÓùÜÀíÔ±Á¬½Ó)Á¬½Óµ½Êý¾Ý¿âºó£¬ÔÚϵͳ±í sys.sysobjvalues²éѯ£¬¸Ã±íµÄÁÐimageval´æ´¢ÁËÏàÓ¦µÄÃÜÎÄ¡£¾ß ......
SQLÖÐonÌõ¼þÓëwhereÌõ¼þµÄÇø±ð
Êý¾Ý¿âÔÚͨ¹ýÁ¬½ÓÁ½ÕÅ»ò¶àÕűíÀ´·µ»Ø¼Ç¼ʱ£¬¶¼»áÉú³ÉÒ»ÕÅÖмäµÄÁÙʱ±í£¬È»ºóÔÙ½«ÕâÕÅÁÙʱ±í·µ»Ø¸øÓû§¡£
ÔÚʹÓÃleft jionʱ£¬onºÍwhereÌõ¼þµÄÇø±ðÈçÏ£º
1¡¢ onÌõ¼þÊÇÔÚÉú³ÉÁÙʱ±íʱʹÓõÄÌõ¼ ......
Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊ ......
procedure Tform1.Button5Click(Sender: TObject);
var
p:pointer;
FrfStr:string;
begin
inherited;
Screen.Cursor:=MYCURSORWAITHAND;
with cdsPrint do
begin
Active:=false;
//Õâ¸öSQLÓÃÓÚ½«remarkÖеļǼºÏ²¢µ½Ò»Æ ......