| | |
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 |
"crystal .net .net2005 30minutes 2008 access add arithmetic array assignment basic binary bing box button buttons center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel file-dialog firewall folder google hardcopy image images isnumericfuntioncall listview login math memory mobile module ms mssqlbackend mysql navigate net networking opacity output pan peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record reports" reuse save savedialog serial sorting sqldatbase storedprocedure string temp text textbox timer toolbox updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





