I loaded data from an Excel spreadsheet to a datagrid. After running the program, the data appears as a "+" sign in the upper lefthand corner of the datagrid. When you click on the "+" sign, a link entitled Table appears to its right. Clicking this link brings
the Excel data on the datagrid. The data looks OK. The question is: why did I initially get a "+" sign instead of the full data in the datagrid? My code is as follows (in VB.Net): Dim strExlConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\users.xls;
Extended Properties= Excel 8.0;" Dim strExlSql As String = "Select * From DEV" ' DEV is the name given the range of data (such as A1:K20) in the Excel Workbook that is to be transferred to the Datagrid. Dim connExl As New OleDbConnection(strExlConn) Dim daExl
As New OleDbDataAdapter(strExlSql, connExl) Dim dsExl As New DataSet daExl.Fill(dsExl) dgExlData.DataSource = dsExl.DefaultViewManager ' daExlData is the name of the datagrid) Can anyone tell me what went wrong? Thanks in advance. sg2000
Although this forum is dedicated to ASP.Net rather than Windows Forms development, i think that setting the DataSource of the drid to the table rather than dataset should solve your problem Cheers
Thanks very much for the response. I found out that the problem is due to the fact that I am building a .Net application as oppose to an ASP application. The same code in ASP environment works OK. Thanks again. sg2000
sg2000
Member
359 Points
154 Posts
Data in Datagrid appears as "+" sign when importing from Excel
Aug 13, 2004 05:41 AM|LINK
Bug_Bugger
All-Star
22605 Points
4505 Posts
Re: Data in Datagrid appears as "+" sign when importing from Excel
Aug 13, 2004 02:47 PM|LINK
sg2000
Member
359 Points
154 Posts
Re: Data in Datagrid appears as "+" sign when importing from Excel
Aug 13, 2004 07:59 PM|LINK