Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
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:
SQL
[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,
Posted
Comments
navya chowdary 2-Sep-14 1:51am    
plzzzzzz i want it quickly
syed shanu 2-Sep-14 1:56am    
How can some one write SP and N-Tire Class for your.Google it there is lots of sample availble for creating Sp and N-Tire Classes.First try by your self and if you found any problem then ask question here.
navya chowdary 2-Sep-14 1:59am    
me searched it,but i didn't get
syed shanu 2-Sep-14 2:12am    
Chk my answer solution ,As a Software professional dont tell as you cont we should always say as we can

1 solution

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[^]
 
Share this answer
 
Comments
navya chowdary 2-Sep-14 3:18am    
i now how to write 3 tier,but i want it using "data reader",and display data in gridview
syed shanu 2-Sep-14 3:22am    
:( its your homework once you completed post here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900