Click here to Skip to main content
15,891,633 members
Home / Discussions / Database
   

Database

 
GeneralRe: Conditions Pin
Khawar Abbas16-Mar-08 1:43
Khawar Abbas16-Mar-08 1:43 
GeneralRe: Conditions Pin
AlexeiXX36-Mar-08 6:05
AlexeiXX36-Mar-08 6:05 
QuestionQuery Scenario Pin
RadioButton5-Mar-08 9:31
RadioButton5-Mar-08 9:31 
GeneralRe: Query Scenario Pin
Michael Potter5-Mar-08 10:03
Michael Potter5-Mar-08 10:03 
GeneralRe: Query Scenario Pin
Ashfield5-Mar-08 21:31
Ashfield5-Mar-08 21:31 
GeneralCreating a Help Form... [modified] Pin
new_phoenix5-Mar-08 9:17
new_phoenix5-Mar-08 9:17 
GeneralWrong forum Pin
pmarfleet5-Mar-08 10:11
pmarfleet5-Mar-08 10:11 
QuestionUsing ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
Mehawitchi5-Mar-08 4:33
Mehawitchi5-Mar-08 4:33 
Hello there,

I have an application in VB.Net in which I import data from Excel files to SQL server database.

I'm trying to retrieve a table in Excel 2007 worksheet, which has more than 255 columns, using Ado.net 2

The problem lies in the "Select * from [Sheet1$]" statement, which will only pick a maximum of 255 columns from the Excel sheet, even though the sheet has around 260 columns.

here is my code for your review:

'*****************************************************************************

'The connection string.
Dim xlCon As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & lblImportFile.Text & _
";Extended Properties=""Excel 12.0;HDR=YES"""


'Excel "SELECT" statement
XlsSQL = "Select * from [Sheet1$]"

'Declare and instantiate the connection object.
Dim con As New OleDbConnection(xlCon)

'Declare and instantiate the command object.
Dim com As New OleDbCommand()

'Declare and instantiate a DataAdapter which fill the dataset with data.
Dim da As New OleDbDataAdapter

'Add values to the command object's properties.
With com
.Connection = con
.CommandType = CommandType.Text
.CommandText = XlsSQL
End With

With da
.AcceptChangesDuringFill = False
.SelectCommand = com

'Add data to the dataset.
.Fill(dsXLData, "Ratings")
End With

da.Dispose()
con.Dispose()
GeneralRe: Using ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
pmarfleet5-Mar-08 8:37
pmarfleet5-Mar-08 8:37 
GeneralRe: Using ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
Mehawitchi5-Mar-08 10:11
Mehawitchi5-Mar-08 10:11 
GeneralRe: Using ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
pmarfleet5-Mar-08 21:38
pmarfleet5-Mar-08 21:38 
GeneralRe: Using ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
Mehawitchi7-Mar-08 9:49
Mehawitchi7-Mar-08 9:49 
GeneralRe: Using ADO.Net to retrieve data from Excel 2007 - Cannot import more than 255 columns Pin
jvandertol122-Jun-09 9:49
jvandertol122-Jun-09 9:49 
QuestionHow to Execute a DTS Package within a Procedure Pin
Vimalsoft(Pty) Ltd4-Mar-08 23:06
professionalVimalsoft(Pty) Ltd4-Mar-08 23:06 
AnswerRe: How to Execute a DTS Package within a Procedure Pin
pmarfleet5-Mar-08 1:14
pmarfleet5-Mar-08 1:14 
GeneralRe: How to Execute a DTS Package within a Procedure Pin
Vimalsoft(Pty) Ltd5-Mar-08 1:18
professionalVimalsoft(Pty) Ltd5-Mar-08 1:18 
GeneralRe: How to Execute a DTS Package within a Procedure Pin
pmarfleet5-Mar-08 1:30
pmarfleet5-Mar-08 1:30 
GeneralRe: How to Execute a DTS Package within a Procedure Pin
Vimalsoft(Pty) Ltd5-Mar-08 1:32
professionalVimalsoft(Pty) Ltd5-Mar-08 1:32 
Generalxls Pin
SVb.net4-Mar-08 21:46
SVb.net4-Mar-08 21:46 
GeneralRe: xls Pin
Krish - KP4-Mar-08 23:27
Krish - KP4-Mar-08 23:27 
GeneralRe: xls Pin
SVb.net4-Mar-08 23:30
SVb.net4-Mar-08 23:30 
GeneralSQL Server 2000 and aspnet_regsql.exe Pin
Brendan Vogt4-Mar-08 21:34
Brendan Vogt4-Mar-08 21:34 
Questiongoto in sql server 2000 stoed procedure Pin
Sonia Gupta4-Mar-08 20:40
Sonia Gupta4-Mar-08 20:40 
GeneralRe: goto in sql server 2000 stoed procedure Pin
pmarfleet4-Mar-08 21:46
pmarfleet4-Mar-08 21:46 
GeneralRe: goto in sql server 2000 stoed procedure Pin
Khawar Abbas15-Mar-08 1:44
Khawar Abbas15-Mar-08 1:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.