Anyone na malupit mag VB?
sana matulungan nyo ako mga ka PM...
Goal:
* Connect The VB to MS Excel as its Database - Status: working okay na.
* Be able to search the products Serial No to display its Product Information.
- hindi pa okay
- my problem
Here's the GUI Screen Shot:// wag nyo muna po pansinin yung edit/update Button.Heres the sample attached data * to be saves as " sampledata.xls " in drive c: (as i stated in the source code)
Serial_No Product Name Product Code Date Purchased Reseller Warranty Details
01a Dell Vostro Laptop Dell-00121 Sept 29,2012 Octagon 2years Sample Data Only
02a MacBook Pro MBP-1111 Sept 29,2012 TCA 1Year Sample Data Only
03a HP Spactre Pro HP1-01 Sept 29,2012 Villman 3Years Sample Data Only
and here is the source code (to be pasted in the Search Button)Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\sampledata.xls';Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
'MyCommand.TableMappings.Add("Table", "Net-informations.com")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()
End Sub
End Class
---
Sana may makatulong
TIA