毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

ASP+SQL SERVER2000电子商城系统 第24页

更新时间:2007-10-19:  来源:毕业论文

 
第三级产品展现
 
后台相应代码:
 
 
if(!IsPostBack)
            {  
                String AName =Session["AName"].ToString() ;
                String BName =Session["BName"].ToString();
 
                String Name =(String)(Request.QueryString["Name"]);
                Session["Name"]=Name;
 
                ANameT.Text =AName;
                BNameT.Text=BName;
                NameT.Text =Name;
 
                adminDB Category = new adminDB();
                Repeater1.DataSource =Category.Products_Name_List(Name);
                Repeater1.DataBind();
            }
 
 
6.2.4 数据库备份与还原
1)数据库备份
 
public bool Backup()
        {
           
            string path=@"C:\BACKUP\ESMS.bak";
            string backupSql="use ESMS backup database ESMS to disk="+path;
           
            // Create Instance of Connection and Command Object
            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
            SqlCommand myCommand = new SqlCommand(backupSql,myConnection);
           
            try
            {
                myCommand.Connection.Open();
                myCommand.ExecuteNonQuery();
                return true;
            }
            catch(Exception ex)
            {
                return false;
            }
            finally
            {
            myCommand.Connection.Close();
            }
              }
 
2) 还原数据库
 
public bool Restore()
        {
           
            string path=@"C:\BACKUP\ESMS.bak";
            string backupSql="use ESMS restore database ESMS from disk="+path;
           
            // Create Instance of Connection and Command Object
            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
            SqlCommand myCommand = new SqlCommand(backupSql,myConnection);
           
            try
            {
                myCommand.Connection.Open();
                myCommand.ExecuteNonQuery();
                return true;
            }
            catch(Exception ex)
            {
                return false;
            }
            finally
            {
                myCommand.Connection.Close();
            }
        }
 
6.2.5相关类库
    public class adminDB
    {
        public adminDB()
        {
           
        }
 
        //产品类型配置
2
        public void  CategoryAdd(String Name, String BName,String AName,String Desn,String Topic)
        {
       
       
            // Create Instance of Connection and Command Object
            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
            SqlCommand myCommand = new SqlCommand("CategoryAdd", myConnection);
 
            // Mark the Command as a SPROC
            myCommand.CommandType = CommandType.StoredProcedure;
 
            // Add Parameters to SPROC
            SqlParameter parameterName = new SqlParameter("@Name", SqlDbType.VarChar ,30);
            parameterName.Value = Name;
            myCommand.Parameters.Add(parameterName);
 
            SqlParameter parameterBName = new SqlParameter("@BName", SqlDbType.VarChar ,30);
            parameterBName.Value = BName;
            myCommand.Parameters.Add(parameterBName);
 
            SqlParameter parameterAName = new SqlParameter("@AName", SqlDbType.VarChar ,30);
            parameterAName.Value = AName;
            myCommand.Parameters.Add(parameterAName);
 
 
            SqlParameter parameterDesn = new SqlParameter("@Desn", SqlDbType.VarChar,80 );
            parameterDesn.Value = Desn;
            myCommand.Parameters.Add(parameterDesn);
 
            SqlParameter parameterTopic = new SqlParameter("@Topic", SqlDbType.Char ,10 );
            parameterTopic.Value = Topic;
            myCommand.Parameters.Add(parameterTopic);
 
            myConnection.Open();
            myCommand.ExecuteNonQuery();
            myConnection.Close();
       
        }
 
        //产品列表
        public SqlDataReader Category_AName_List()
        {
       
       
            // Create Instance of Connection and Command Object
            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
            SqlCommand myCommand = new SqlCommand("Category_AName_List", myConnection);
 
            // Mark the Command as a SPROC

 << 上一页  [21] [22] [23] [24] [25] [26] [27] [28] [29] [30]  ... 下一页  >> 

ASP+SQL SERVER2000电子商城系统 第24页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。