Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
- Dim conn As New OleDbConnection
- Dim connString As String
- Dim cmd As New OleDbCommand
- Try
- ' Set the connection string.
- connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data
- Source=C:UsersSF7DesktopShore Fresh Logistics_be_be.accdb"
- ' Open the connection.
- conn.ConnectionString = connString
- conn.Open()
- 'Set the command properties.
- cmd.Connection = conn
- cmd.CommandText = "SELECT PalletNumber, MAX(PalletNumber) FROM
- tblPalletNumber"
- txbPalletNumber.Text = cmd.ExecuteScalar()
- conn.Close()
- GridView1.DataBind()
- Catch ex As Exception
- 'Error handling
- End Try
- txbPackday.Text = DateAndTime.Now
- End Sub
Add Comment
Please, Sign In to add comment