本文介绍了从SQL Server获取自动增益编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从sql server到vb.net windows窗体显示自动增量编号到文本框/ lsbel
我尝试过:
how to display auto increment number from sql server to vb.net windows form to text box/lsbel
What I have tried:
Dim Nextid As String
Dim connection As New SqlConnection("server= madhuresh-pc; database= madhu; integrated security= true")
connection.Open()
Dim cmd As New SqlCommand("SELECT MAX(caseno+1) As 'NextId' FROM case1", connection)
Nextid = cmd.ExecuteScalar()
txtstation.Text = Nextid
connection.Close()
End Sub
推荐答案
这篇关于从SQL Server获取自动增益编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!