| | |
importing data from excel to comboBox
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 4689 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application array assignment basic binary box button buttons center code connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net employees error excel exists firewall folder function image images isnumericfuntioncall listview login math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan peertopeervideostreaming picturebox plugin port print printing printpreview problem record refresh reports" reuse save savedialog search serial sorting sql sqldatbase storedprocedure string structures studio temp textbox timer upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





