gpt4 book ai didi

c# - LINQ 和 SQL 注入(inject)

转载 作者:太空宇宙 更新时间:2023-11-03 17:26:18 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Will using LINQ to SQL help prevent SQL injection

我正在使用 LINQ 访问 sql 数据库。以下代码安全吗?

 var addRec = (from p in db.5544
where p.ID == newAddID
select p).Single();

addRec.Address1 = comAddTxt1.Text; //create address record
addRec.Address2 = comAddTxt2.Text;
addRec.Address3 = comAddTxt3.Text;
addRec.Address4 = comAddTxt4.Text;
addRec.PostCode = pstCdeTxt.Text;
addRec.Town = twnTxt.Text;
addRec.County = cntyTxt.Text;
addRec.Country = cntComBox.SelectedItem.Text;

db.SubmitChanges();

谢谢,

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com