VB.NET中使用Linq TO SQL添加数据后获得自增长列ID VB.NET中使用Linq TO SQL添加数据后获得自增长列ID: Dim tempOrdre As New Order With {.CustomerID = cmbCustomerName.SelectedValue.ToString,.ProductID = cmbProductSpec.SelectedValue.ToString,.Pro
VB.NET中使用Linq TO SQL添加数据后获得自增长列ID
vb.net中使用linq to sql添加数据后获得自增长列id:
Dim tempOrdre As New Order With { .CustomerID = cmbCustomerName.SelectedValue.ToString, .ProductID = cmbProductSpec.SelectedValue.ToString, .ProductNumber = txtProductNumber.Text.Trim, .BatchNO = txtBatchNO.Text.Trim, .OrderDate = dtpOrderDate.Value.ToShortDateString } db.Order.InsertOnSubmit(tempOrdre) Try db.SubmitChanges() ’提交数据库操作 Dim intid As Integer = tempOrdre.OrderID ‘获得自增长列ID MessageBox.Show(intid) ’显示ID Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try
posted on
,美国服务器,香港服务器,香港虚拟主机每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号