| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 901 人关注过本帖
标题:数据访问技术——ADO.NET 2.0
只看楼主 加入收藏
恩有点呆
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-14
收藏
 问题点数:0 回复次数:1 
数据访问技术——ADO.NET 2.0
1、从表Production.ProductInventory中查出所有的产品库存记录并显示
2、界面上输出一个产品的id,查出指定id商品在Sales.SalesOrderDetail表中的销售数量与平均价格
3、输入一个产品id,将他库存表中的"库存数量" 减去 “销售数量”,使用存储过程
4、如果更新后的库存数量小于10,存储过程返回一个告警信息,前端界面上显示。


分析
1、使用ExecuteReader
2、使用executeScalar,可能使用参数
3、使用ExecuteNonQuery(),肯定要使用参数
4、output参数
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteReader
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}



using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteScalar
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}



using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteNonQuery
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}


恳请高手赶紧帮我解决啦,后天就要考试了啊

[[it] 本帖最后由 恩有点呆 于 2008-11-15 16:35 编辑 [/it]]
搜索更多相关主题的帖子: ADO NET 数据 技术 访问 
2008-11-14 10:47
恩有点呆
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-14
收藏
得分:0 
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteReader
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}



using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteScalar
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}



using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ExecuteNonQuery
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
2008-11-15 16:33
快速回复:数据访问技术——ADO.NET 2.0
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014674 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved