1
我有一个向数据库添加记录的表单。主键是自动递增的。我希望将网页重定向到显示刚输入信息的页面。SubmitChanges立即取回记录
例如,如果1019是下一个生成的数字,它将重定向到http://localhost/details.aspx?softwareID=1019。
以下是将其提交给数据库的代码。
software software = new software
{
EQCN = txtEQCN.Text,
title = txtTitle.Text,
version = txtVersion.Text,
license = txtLicense.Text,
expirationDate = txtExpirationDate.Text
};
db.softwares.InsertOnSubmit(software);
db.SubmitChanges();
LINQ to SQL,对吗? – CodingGorilla
是的,它的LINQ to SQL – gberg927