ASP.NETÔ¶³Ì±¸·Ý»Ö¸´SQL ServerÊý¾Ý¿â
///<summary>
///±¸·ÝÊý¾Ý¿âµ½±¾µØ´ÅÅÌ
///</summary>
public bool BackUp(string BackUpFile)
{
try
{
//µÚÒ»²½£ºÔÚ·þÎñÆ÷ÉÏ´´½¨ÁÙʱÎļþ¼Ð
ExecuteSql(@"master..xp_cmdshell 'md C:\temp'");
ExecuteSql(@"master..xp_cmdshell 'del C:\temp\*.* /q'");
//µÚ¶þ²½£º±¸·ÝÊý¾Ý¿âµ½·þÎñÆ÷Ŀ¼
ExecuteSql(@"backup database " + DataBaseName() + @" to disk='C:\temp\HSSY'");
//µÚÈý²½£º¹²Ïí·þÎñÆ÷µÄ±¸·ÝĿ¼
ExecuteSql(@"master..xp_cmdshell 'net share SQLDATABACK=C:\temp'");
//µÚËIJ½£º¸´ÖÆ·þÎñÆ÷Éϵı¸·ÝÎļþµ½±¾µØ
File.Copy(@"\\" + ServerIP() + @"\SQLDATABACK\HSSY", BackUpFile,true);
return true;
}
catch (System.Data.SqlClient.SqlException E)
{
throw new Exception(E.Message);
}
Ïà¹ØÎĵµ£º
(1)SEQNAME.NEXTVALÀïÃæµÄÖµÈçºÎ¶Á³öÀ´£¿¿ÉÒÔÖ±½ÓÔÚinsert into test values(SEQNAME.NEXTVAL) ÊÇ¿ÉÒÔÓà ÕâÑù£º
SELECT tmp#_seq.NEXTVAL
INTO id_temp
from DUAL; È»ºó¿ÉÒ ......
C# SQLÊý¾Ý¿â²Ù×÷ͨÓÃÀà
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
namespace Framework.DataBase
{
///
/// ͨÓÃÊý¾Ý¿âÀà
///
public class DataBase
{
private string ConnStr = null;
public DataBase()
{
&nb ......
×¢Òâ:
ÔÚʹÓÃFindControlʱ,Ò»¶¨ÒªÔÚ×îÌù½ü²éÕÒ¶ÔÏóµÄÍâ±ß¼ÓÉϸöÈÝÆ÷,Èç¹ûÄãÖ±½ÓÓÃthis.FindControl,»òPage.FindControlÄÇô¾Í»á¾³£³öÏÖ佫¶ÔÏóÉèÖõ½ÊµÀý
µÄ´íÎó,ËùÒÔ×îºÃ¼ÓÒ»¸öÈÝÆ÷,ÄÇôÕâÀï¼ÓµÄDIV¾ÍÊÇÒ»¸öÈÝÆ÷,ΪÁËÈÃFindControlÔÚIDΪ"TextBoxs"µÄDIVÄÚÈ¥ÕÒÃûΪcom1,com2,com3µÄTextBOx;
<div ......