为给定代码编写存储过程,数据访问层(DAL) [英] write stored procedure,Data Access layer(DAL) for given code

查看:113
本文介绍了为给定代码编写存储过程,数据访问层(DAL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cmd.CommandText = "select [prod_code] as prod_code ,[prod_desc] prod_desc,prod_uom from products where comp_id='" +
                        cpnyid + "' and prod_deleted=0 and prod_cate='" + cfs.singlequotconver(ddl_Cate.Text) + "' order by prod_code";
                    dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        try
                        {
                            object[] obj = { "", dr["prod_code"].ToString(), dr["prod_desc"].ToString(), dr["prod_uom"].ToString(),
                                   cfs.getonhand(cfs.sqldateconverion(System.DateTime.Now), dr["prod_code"].ToString(), cpnyid), ""};
                            dataGridViewEx1.Rows.Add(obj);
                        }
                        catch { }



数据库产品:


database products:

[prod_id] [bigint] IDENTITY(1,1) NOT NULL,
    [comp_id] [int] NULL,
    [prod_code] [nvarchar](30) NULL,
    [prod_desc] [nvarchar](200) NULL,
    [prod_bcode] [nvarchar](50) NULL,
    [prod_pack] [nvarchar](200) NULL,
    [prod_type] [nvarchar](50) NULL,
    [prod_cate] [nvarchar](30) NULL,

推荐答案

Google中的简单类型如何创建Sp并在DAL中调用它#

在这里你可以看到大量的样本网站:



https://www.google.co.in/#q=how+to+create+Sp+and+call+it+in+DAL+c %23 [ ^ ]



这里有一个最符合您要求的链接:

DAL类和Transact-SQL生成器 [ ^ ]
Simple in Google type "how to create Sp and call it in DAL c#"
here you can see plenty of sample sites :

https://www.google.co.in/#q=how+to+create+Sp+and+call+it+in+DAL+c%23[^]

here is one best link which has all your requirement :
DAL Class and Transact-SQL Generator for C# and VB.NET[^]


这篇关于为给定代码编写存储过程,数据访问层(DAL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆