ASP.netÒ³ÃæʵÏÖMSSQLÊý¾Ý¿âµÄ´´½¨ºÍ²Ù×÷£¬ÊÇ¿â´´½¨£¡
/// <summary>
/// ´´½¨Êý¾Ý¿â¡£
/// </summary>
/// <param name="srvName">±íʾҪÁ¬½ÓµÄ·þÎñÆ÷Ãû</param>
/// <param name="dbName">Ö¸¶¨Òª´´½¨µÄÊý¾Ý¿âÃû</param>
private string CreateDB(string srvName, string dbName)
{
SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(srvName, "sa", "");
// н¨Êý¾Ý¿âÃû(°üÀ¨Â·¾¶)
string dbPath = srv.Registry.SQLDataRoot + "\\DATA\\" + dbName;
bool DBExist = false;
foreach (SQLDMO.Database db in srv.Databases)
{
if (db.Name == dbName)
{
DBExist = true;
}
}
&nbs
Ïà¹ØÎĵµ£º
public class DBHelper
{
private static SqlConnection connection;
public static SqlConnection Connection
{
&nb ......
1¡¢Ìí¼ÓWeb.config£¬ < system.web>< /system.web>ÖÐÌí¼Ó< customErrors mode="On"
defaultRedirect="ApplicationErroy.aspx" >< /customErrors>½Úµã£¬
2¡¢Ìí¼ÓGlobal.asaxÎļþ£¬ÕÒµ½Application_Errorʼþ£¬¼ÓÈëÒÔÏ´úÂ룺
//ÕâÊÇÌí¼ÓÁËÒ»¸öÈ«¾ÖÓ¦ÓÃ³Ì ......
11ÔÂ21ÈÕÍí£·µãÓ¦ÑûÔÚÎ人´óѧÐÅϢѧԺ×öÁËÒ»³¡¹ØÓÚASP.NETÏÂAJAX¿ª·¢µÄ±¨¸æ£¬ÒÔÎÒ×Ô¼º¾Àú½²ÊöÁËһЩÌØÊâÓ¦ÓÃÔÚ¹ýÈ¥µ½ÏÖÔÚʵÏÖÊֶεı仯£¬±¾À´Ïë»Ø¼ÒÖ®ºó×ö¸ö×ܽáµÄ£¬µ«ÊÇÓÉÓÚ×î½üÒÔÀ´ÊÂÇéÒ»Ö±ºÜ¶à£¬ËùÒÔûÓÐÀ´µÃ¼°×ܽᡣ½ñÍíµÃÒÔÓпÕ×ܽáһϡ£
AJAX½éÉÜ
ÆäʵAJAXÓ¦ÓÃµÄºË ......
µÚÒ»ÖÖ
<%=RetInfo("DB","Êý¾Ý¿â") %>
<%=RetInfo("YX_UpFile","ÉÏ´«Îļþ") %>
<%=RetfileInfo("Include/", "¹ã¸æ")%>
//´Óǰ̨µ÷Óúǫ́·½·¨
//´Óǰ̨µ÷Óúǫ́µÄ·½·¨..²¢ÏòÆä·½·¨´«È벻ͬµÄ²ÎÊý!
µÚ¶þÖÖ
<ItemTemplate >
<%#Ret_stat(Convert.ToInt16(Eval("YX_Stat1")), "Èȵã")%>
......
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö asp.net Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ» Visual Studio .NET »á×Ô¶¯²åÈëÕ⸠......