Public Sub increment() If cnn.State = ConnectionState.Closed Then cnn.Open() End If Dim bookid As Double bookid = ds.Tables(0).Compute("Max(Book_id)", Nothing) TextBox14.Text = bookid + 1 End Sub
If cnn.state<>1 cnn.open() End If cmd.commandText="select max(id) from table" Textbox1.text=cmd.ExecuteScalar()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)