资源简介

[SQL Server实用教程(第4版)(SQL Server 2012版)][郑阿奇][程序源代码],书本上的源代码,欢迎大家下载学习...

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;//
using System.Data;//
using System.Configuration;//

namespace bookManage
{
    public partial class BorrowBook : System.Web.UI.Page
    {
        protected string connStr = ConfigurationManager.ConnectionStrings[“MBOOKConnectionString“].ConnectionString;           //获取连接字符串
        protected void Page_Load(object sender EventArgs e)
        {

        }

        protected void Button1_Click(object sender EventArgs e)
        {
            GridView1.DataBind();   //GridView1重新绑定
        }

        protected void Button2_Click(object sender EventArgs e)
        {
            if (TextBox1.Text.Trim() == ““ || TextBox2.Text.Trim() == ““ || TextBox3.Text.Trim() == ““)
            {
                Response.Write(“ript>alert(‘借书证号,ISBN,索书号输入完整!‘)ript>“);
                return;
            }
            SqlConnection conn = new SqlConnection(connStr);        //新建数据库连接对象
            SqlCommand cmd = new SqlCommand(“book_borrow“ conn);   //新建数据库命令对象
            cmd.CommandType = CommandType.StoredProcedure;          //设置命令类型为存储过程
            //新建并设置参数
            SqlParameter inReaderID = new SqlParameter(“@in_ReaderID“ SqlDbType.Char 8);
            inReaderID.Direction = ParameterDirection.Input;        //参数类型为输入参数
            inReaderID.Value = TextBox3.Text.Trim(); //给参数赋值
            cmd.Parameters.Add(inReaderID);
            SqlParameter inISBN = new SqlParameter(“@in_ISBN“ SqlDbType.Char 18);
            inISBN.Direction = ParameterDirection.Input;
            inISBN.Value = TextBox1.Text.Trim();
            cmd.Parameters.Add(inISBN);
            SqlParameter inBookID = new SqlParameter(“@in_BookID“ SqlDbType.Char 8);
            inBookID.Direction = ParameterDirection.Input;
            inBookID.Value = TextBox2.Text.Trim();
            cmd.Parameters.Add(inBookID);
            SqlParameter outReturn = new SqlParameter(“@out_str“ SqlDbType.Char 30);
            outReturn.Direction = ParameterDirection.Output;        //参数类型为输出参数
            cmd.Parameters.Add(outReturn);                          //添加参数
            try
            {
                conn.Open();                                        //打开数据库连接
                cmd.ExecuteNonQuery();                              //执行存储过程
                Response.Write(“ript>alert(‘“ + outReturn.Value.ToString() + “‘)ript>“);
            }
            catch
            {
                Response.Write(“ript>alert(‘借书出错!‘)ript>“);
            }
            finally
            {
                conn.Close();
                GridView1.DataBind();                               //重新绑定GridView1数据源
            }
        }

        protected void Button3_Click(object sender EventArgs e)
        {
            if (TextBox2.Text == ““)    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      13312  2014-11-20 14:15  源程序\ASP.NET\bookManage\bookManage\bin\bookManage.dll

     文件        566  2014-11-15 11:57  源程序\ASP.NET\bookManage\bookManage\bin\bookManage.dll.config

     文件      28160  2014-11-20 14:15  源程序\ASP.NET\bookManage\bookManage\bin\bookManage.pdb

     文件       6571  2014-11-15 10:16  源程序\ASP.NET\bookManage\bookManage\bookManage.csproj

     文件       1086  2014-11-15 10:16  源程序\ASP.NET\bookManage\bookManage\bookManage.csproj.user

     文件       4179  2014-11-20 11:14  源程序\ASP.NET\bookManage\bookManage\BorrowBook.aspx

     文件       4572  2014-11-18 17:13  源程序\ASP.NET\bookManage\bookManage\BorrowBook.aspx.cs

     文件       4910  2014-11-18 15:10  源程序\ASP.NET\bookManage\bookManage\BorrowBook.aspx.designer.cs

     文件       3481  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\借书查询.gif

     文件       3479  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\借书还书.gif

     文件       3144  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\关于.gif

     文件       3515  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\图书查询.gif

     文件       3466  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\图书管理.gif

     文件      13292  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\图书管理系统.gif

     文件      16259  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\师教网络服务平台.gif

     文件       3047  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\背景.gif

     文件       3514  2014-11-14 17:07  源程序\ASP.NET\bookManage\bookManage\images\读者管理.gif

     文件       2200  2014-11-17 10:17  源程序\ASP.NET\bookManage\bookManage\MasterPage.Master

     文件        340  2014-11-14 17:05  源程序\ASP.NET\bookManage\bookManage\MasterPage.Master.cs

     文件       2240  2014-11-15 09:33  源程序\ASP.NET\bookManage\bookManage\MasterPage.Master.designer.cs

     文件        676  2014-11-15 15:44  源程序\ASP.NET\bookManage\bookManage\obj\Debug\bookManage.csproj.FileListAbsolute.txt

     文件       3212  2014-11-15 15:44  源程序\ASP.NET\bookManage\bookManage\obj\Debug\bookManage.csprojResolveAssemblyReference.cache

     文件      13312  2014-11-20 14:15  源程序\ASP.NET\bookManage\bookManage\obj\Debug\bookManage.dll

     文件      28160  2014-11-20 14:15  源程序\ASP.NET\bookManage\bookManage\obj\Debug\bookManage.pdb

     文件       9341  2014-11-15 10:19  源程序\ASP.NET\bookManage\bookManage\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2014-11-14 16:21  源程序\ASP.NET\bookManage\bookManage\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2014-11-14 16:21  源程序\ASP.NET\bookManage\bookManage\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2014-11-14 16:21  源程序\ASP.NET\bookManage\bookManage\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        399  2014-11-14 16:37  源程序\ASP.NET\bookManage\bookManage\Pic.aspx

     文件       2614  2014-11-18 11:01  源程序\ASP.NET\bookManage\bookManage\Pic.aspx.cs

............此处省略178个文件信息

评论

共有 条评论