TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Erdinc Kolukisa
NA
113
0
multilayer programming insert problem
Oct 12 2010 4:58 AM
hey guys...i want to improve my skills and that is why i develop a project by using multilayer project..but i have a problem which is i cant understand the logic how i will interact DAL layer and Helper layer...i try to add the datas with stored procedure which is like that
ALTER
procedure
[dbo]
.
[sp_AddDatas]
(
@firmanin_adi
nvarchar
(
70
),
@firmanin_adresi
nvarchar
(
max
),
@yetkili_ismi
nvarchar
(
50
),
@firmanin_email
nvarchar
(
50
),
@firmanin_email2
nvarchar
(
50
),
@referans_bilgisi
nvarchar
(
max
),
@ntlar_aciklmlar
nvarchar
(
max
),
@gsm_num1
nvarchar
(
20
),
@gsm_num2
nvarchar
(
20
),
@sbt_num
nvarchar
(
20
)
)
as
BEGIN
Set
Nocount
On
Declare
@id
int
Select
@id
=
id
From
Firmalar
where
firma_adi
=
@firmanin_adi
If
isnull
(
@id
,
0
)=
0
Begin
Insert
Into
Firmalar
(
firma_adi
,
adres
,
yetkili_ad
,
email
,
email2
,
referans
,
not_aciklama
)
Values
(
@firmanin_adi
,
@firmanin_adresi
,
@yetkili_ismi
,
@firmanin_email
,
@firmanin_email2
,
@referans_bilgisi
,
@ntlar_aciklmlar
)
Select
@id
=
@@Identity
Insert
Into
Telefon
(
gsm1
,
gsm2
,
numara
,
yetkili_ad
,
firma_id
)
Values
(
@gsm_num1
,
@gsm_num2
,
@sbt_num
,
@yetkili_ismi
,
@id
)
End
Else
Begin
Insert
Into
Telefon
(
gsm1
,
gsm2
,
numara
,
yetkili_ad
,
firma_id
)
Values
(
@gsm_num1
,
@gsm_num2
,
@sbt_num
,
@yetkili_ismi
,
@id
)
End
END
i wrote a method in my Helper class to interact with that procedure like below
public
void
InsertDatas(
Firmalar
firma)
{
frm =
new
FirmaEklemeFormu
();
SqlDataReader
dr = d.InsertData();
firma.firma_adi = frm.txtFirma_adi.Text;
firma.adres = frm.txtAdres.Text;
firma.yetkili_ad = frm.txtYetkili_adi.Text;
firma.email = frm.txtEmail.Text;
firma.email2 = frm.txtEmail2.Text;
firma.referans = frm.txtReferans.Text;
firma.not_aciklama = frm.txtNot_aciklama.Text;
}
but i have some other parameters for my stored procedure in another form...i dont know how i can add that data in multilayer design or am i in the right way...i need help guys
Reply
Answers (
1
)
Passing Variables to MDIChild form?
Using the generic type 'System.Collections.Generic.IEnumerable
' requires '1' type arguments