<script runat="server">
Private Sub form_Load(sender As Object, e As EventArgs)
Dim objConn As New Data.Odbc.OdbcConnection()
Dim objCmd As New Data.Odbc.OdbcCommand()
Dim strConnString As String
strConnString = "Driver={SQL Server};Server=xxx;Database=yyy;Uid=sa;Pwd=zzzz"
objConn.ConnectionString = strConnString
objConn.Open()
BindData()
End Sub
Sub BindData()
Dim strSQL As String
Dim objConn As SqlDataSource
strSQL = "SELECT * FROM Warehouse"
Dim dtReader As Data.IDbConnection
objConn = New String(strSQL, objConn)
dtReader = ObjectDataSourceView.()
dtReader.Close()
dtReader = Nothing
End Sub
Private Sub GridView_RowDataBound(sender As Object, e As GridViewRowEventArgs)
'*** StockName ***'
Dim lblStockName As Label = CType(e.Row.FindControl("lblStockName"), Label)
If Not IsNothing(lblStockName) Then
lblStockName.Text = e.Row.DataItem("StockName")
End If
'*** ProName ***'
Dim lblProName As Label = CType(e.Row.FindControl("lblProName"), Label)
If Not IsNothing(lblProName) Then
lblProName.Text = e.Row.DataItem("ProName")
End If
'*** ProTotal ***'
Dim lblProTotal As Label = CType(e.Row.FindControl("lblProTotal"), Label)
If Not IsNothing(lblProTotal) Then
lblProTotal.Text = e.Row.DataItem("ProTotal")
End If
'*** Available ***'
Dim txtAvailable As TextBox = CType(e.Row.FindControl("txtAvailable"), TextBox)
If Not IsNothing(txtAvailable) Then
txtAvailable.Text = e.Row.DataItem("Available")
End If
End Sub
</script>