ng sRemark)
{
///定义类SQLHelper
SQLHelper.SQLHelper sqlHelper = new SQLHelper.SQLHelper();
///创建访问数据库的参数
SqlParameter[] paramList = {
sqlHelper.CreateInParam("@Name",SqlDbType.VarChar,200,sName),
sqlHelper.CreateInParam("@CategoryID",SqlDbType.Int,4,nCategoryID),
sqlHelper.CreateInParam("@Desn",SqlDbType.VarChar,200,sDesn),
sqlHelper.CreateInParam("@Author",SqlDbType.VarChar,200,sAuthor),
sqlHelper.CreateInParam("@Publish",SqlDbType.VarChar,200,sPublish),
sqlHelper.CreateInParam("@PublishDate",SqlDbType.DateTime,8,dPublishDate),
sqlHelper.CreateInParam("@ISBN",SqlDbType.VarChar,200,sISBN),
sqlHelper.CreateInParam("@Foreword",SqlDbType.VarChar,8000,sForeword),
sqlHelper.CreateInParam("@List",SqlDbType.VarChar,8000,sList),
sqlHelper.CreateInParam("@OutLine",SqlDbType.VarChar,8000,sOutLine),
sqlHelper.CreateInParam("@BuyInDate",SqlDbType.DateTime,8,dBuyInDate),
sqlHelper.CreateInParam("@Price",SqlDbType.Money,8,dPrice), sqlHelper.CreateInParam("@TotalNum",SqlDbType.Int,4,nTotalNum),
sqlHelper.CreateInParam("@Remark",SqlDbType.VarChar,8000,sRemark)
};
try
{
///执行存储过程
return (sqlHelper.RunProc("Pr_AddBook",paramList));
}
catch (Exception ex)
{
///抛出执行数据库异常
SystemError.CreateErrorLog(ex.Message);
throw new Exception(ex.Message,ex);
}
}