Hi, im doing a piece of work that needs to be completed soon.
Basically its a vb.net project where I have to use OLE commands and access queries to access a database and manipulate it.
This is one of the things I need to do:
I've created the load data sub and I can get all the products loaded up onto the datagrid. the picture also loads onto the datagrid.
I'm having problems getting the image and description onto the textbox and picturebox.
This is the code ive used for the load data sub so you have an idea of the kind of level of coding I need to do (I am hopeless at VB.net, a lot of the code used here is from the tutorials I did before that are supposed to help)
And variables used in the above sub are:
So the first thing I need to do is get the picture and description to be displayed onto a picturebox and textbox.
Basically its a vb.net project where I have to use OLE commands and access queries to access a database and manipulate it.
This is one of the things I need to do:
Construct a file menu item that contains a sub menu item Load data. On selecting this item the entire catalogue of products should be displayed within a datagrid on the form. The image2 for the initial product should be displayed on the form together with the product full description. When a different product is selected from the datagrid the description and image data should be updated to reflect the new products detail. The user should be able to navigate through the rows of information within the datagrid by using the up and down arrows on the keyboard
I've created the load data sub and I can get all the products loaded up onto the datagrid. the picture also loads onto the datagrid.
I'm having problems getting the image and description onto the textbox and picturebox.
This is the code ive used for the load data sub so you have an idea of the kind of level of coding I need to do (I am hopeless at VB.net, a lot of the code used here is from the tutorials I did before that are supposed to help)
Private Sub LoadDataToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadDataToolStripMenuItem.Click
conn = New OleDbConnection(strConn) ' making the connection
dv = New DataView
ds = New DataSet
adaptor = New OleDbDataAdapter(strSQL, conn)
cmdbld = New OleDbCommandBuilder(adaptor) ' openin the db and giving the command
adaptor.Fill(ds, "products") ' fills the dataset
dv.Table = ds.Tables("products") ' gives the dataset to the table
DataGridView1.DataSource = dv ' displays the dataview to the datagrid
End Sub
And variables used in the above sub are:
Private strSQL As String = "SELECT tblProducts.ProductID, tblProducts.ProductName, tblProducts.ProductCategoryID,tblProducts.ProductPicture, tblProducts.FullDescription, tblProducts.Price, tblProducts.StockLevel FROM tblProducts;"
Private strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\UNI\Dataprogramming\Assignment\Students assignment resources\Gadgets.mdb"
Private ds As DataSet ' declares a new dataset
Private dv As DataView ' declares dv as dataview
Private adaptor As OleDbDataAdapter ' declares adaptor to be used in this form instead of the full command
Private conn As OleDbConnection ' declares conn to be used in this form instead of the full command
Private cmdbld As OleDbCommandBuilder ' declares cmdbld to be used in this form instead of the full command
So the first thing I need to do is get the picture and description to be displayed onto a picturebox and textbox.