| | |
importing data from excel to comboBox
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 18
Reputation:
Solved Threads: 0
hi every one after connecting to an excel file I want to import the firts row into a combobox
in the connection function I added thhis
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from[sheet1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Attendence")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ComboBox1.datasource= DtSet.Tables(0) i think this is error
and when I run my combo box will get filled with nSystem.Data.DataRowView
by the way I want only th first row to get imported in my cobo box how is the sql query
thanks in advance
in the connection function I added thhis
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from[sheet1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Attendence")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ComboBox1.datasource= DtSet.Tables(0) i think this is error
and when I run my combo box will get filled with nSystem.Data.DataRowView
by the way I want only th first row to get imported in my cobo box how is the sql query
thanks in advance
Hi,
Here is a link to Ken Getz's really good artile on manipulating Exel with
VB.NET. It includes the logic you need to extract things such as worksheets
which would allow you to create your ComboBox:
http://msdn.microsoft.com/library/d...ml/ExcelObj.asp
Here is a link to Ken Getz's really good artile on manipulating Exel with
VB.NET. It includes the logic you need to extract things such as worksheets
which would allow you to create your ComboBox:
http://msdn.microsoft.com/library/d...ml/ExcelObj.asp
Regards,
Shikeb Ali
------------------------------------------
“Beware the fury of a patient man.”
Shikeb Ali
------------------------------------------
“Beware the fury of a patient man.”
•
•
•
•
and when I run my combo box will get filled with nSystem.Data.DataRowView
vb.net Syntax (Toggle Plain Text)
ComboBox1.DataSource = dt.Tables( 0 ) ComboBox1.DisplayMember = "Name"
The truth does not change according to our ability to stomach it.
•
•
Join Date: Aug 2007
Posts: 18
Reputation:
Solved Threads: 0
hey hamrik
I did it for one comboBox it works and the second I wanted it to be filled with the other column and I put the name of that culumn but u know what ? the combo box will get filled with the previous column that means both ae the same here is the code:
Dim ComboBox2 As ComboBox
ComboBox1.DataSource = DtSet.Tables(0)
ComboBox1.DisplayMember = "Iso Standards"
ComboBox2.DataSource = DtSet.Tables(0)
ComboBox2.DisplayMember = "MVB Standard"
I did it for one comboBox it works and the second I wanted it to be filled with the other column and I put the name of that culumn but u know what ? the combo box will get filled with the previous column that means both ae the same here is the code:
Dim ComboBox2 As ComboBox
ComboBox1.DataSource = DtSet.Tables(0)
ComboBox1.DisplayMember = "Iso Standards"
ComboBox2.DataSource = DtSet.Tables(0)
ComboBox2.DisplayMember = "MVB Standard"
![]() |
Similar Threads
- Retriving data from excel sheet into an asp page (ASP)
- Get data out of excel file stored as an image (MS SQL)
- sending data to and receiving data from excel (VB.NET)
- Export data to Excel Template (MS Access and FileMaker Pro)
- Importing data from txt file (MS SQL)
- Transferring data to Excel (ASP.NET)
- Error message while importing data to Excel from the MySQL db (MySQL)
- Exporting Data from App To Excel c# (C#)
- Exporting data into Excel (C)
Other Threads in the VB.NET Forum
- Previous Thread: Shortcut
- Next Thread: Creating Table using SQL query from wondows Form
| Thread Tools | Search this Thread |
.net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists filter forms function html images isnumericfuntioncall listview map mobile module msaccess mssqlbackend mysql net number open page pan panel pdf picturebox picturebox2 port position print printing printpreview read record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winsock wpf wrapingcode xml year





