Click here to Skip to main content
16,005,124 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to edit data in gridview Pin
Enigma344014-Mar-06 1:20
Enigma344014-Mar-06 1:20 
GeneralRe: How to edit data in gridview Pin
albCode14-Mar-06 2:55
albCode14-Mar-06 2:55 
QuestionSP to Convert all DbTables to Excel sheet Pin
HimaBindu Vejella13-Mar-06 18:23
HimaBindu Vejella13-Mar-06 18:23 
AnswerRe: SP to Convert all DbTables to Excel sheet Pin
Vasudevan Deepak Kumar13-Mar-06 19:01
Vasudevan Deepak Kumar13-Mar-06 19:01 
GeneralRe: SP to Convert all DbTables to Excel sheet Pin
HimaBindu Vejella13-Mar-06 19:12
HimaBindu Vejella13-Mar-06 19:12 
GeneralRe: SP to Convert all DbTables to Excel sheet Pin
HimaBindu Vejella16-Mar-06 20:47
HimaBindu Vejella16-Mar-06 20:47 
AnswerRe: SP to Convert all DbTables to Excel sheet Pin
sathish s13-Mar-06 23:27
sathish s13-Mar-06 23:27 
QuestionOLE DB/JET and Excel - Reading Data, Error Handling Pin
mcljava13-Mar-06 9:47
mcljava13-Mar-06 9:47 
I recently started a C# prototype using the OLE DB access method to read from a hefty Excel spreadsheet that we use at the office. The nice thing about OLE DB is you can read Excel worksheets pretty easily, and in block read style.

H O W E V E R, when was the last time you saw a clean error free, perfectly formatted spreadsheet?
That's where I am stuck. It seems the OLE DB driver/JET engine will happily retrieve the specified query range but it also supplies a null for any cell it doesn't like and considers to have an error. Is there a way to override this behavior and tell OLEDB through the DataSet or ExtendedProperties to retrive all data "as is" thus ignoring any cell errors?

FYI, here is how I am reading a worksheet in one read. In my case I know there are roughly 330-370 rows per worksheet, so I specify a range of 400 rows:

<br />
// open the JET connection<br />
OleDbConnection con = new OleDbConnection( connectionOpts );<br />
con.Open();<br />
<br />
// build the query<br />
string query = string.Format( "SELECT * FROM [{0}$[1]]", tableName, queryRange );<br />
<br />
// fill the dataset<br />
OleDbDataAdapter oleAdapter = new OleDbDataAdapter();<br />
oleAdapter.SelectCommand = new OleDbCommand( query, con );<br />
DataSet ds = new DataSet();<br />
int rowsProcessed = oleAdapter.Fill( ds, "data" );<br />
<br />
// free up resources<br />
oleAdapter.Dispose();<br />
oleAdapter.Close();<br />
etc.<br />




Mike Luster
CTI/IVR/Telephony SME
QuestionCheck if SQL Server is running through code Pin
theanton13-Mar-06 8:45
theanton13-Mar-06 8:45 
AnswerRe: Check if SQL Server is running through code Pin
Vasudevan Deepak Kumar13-Mar-06 19:02
Vasudevan Deepak Kumar13-Mar-06 19:02 
Questionstore swf file Pin
LovelyHelp13-Mar-06 2:17
LovelyHelp13-Mar-06 2:17 
AnswerRe: store swf file Pin
Vasudevan Deepak Kumar13-Mar-06 18:59
Vasudevan Deepak Kumar13-Mar-06 18:59 
GeneralRe: store swf file Pin
LovelyHelp15-Mar-06 1:15
LovelyHelp15-Mar-06 1:15 
QuestionSQL 2005 Pin
Illegal Operation13-Mar-06 1:08
Illegal Operation13-Mar-06 1:08 
AnswerRe: SQL 2005 Pin
Mike Dimmick13-Mar-06 2:01
Mike Dimmick13-Mar-06 2:01 
AnswerRe: SQL 2005 Pin
HimaBindu Vejella14-Mar-06 0:25
HimaBindu Vejella14-Mar-06 0:25 
QuestionPerformance problem when closing the SqlDataReader Pin
CADMIN12-Mar-06 21:20
professionalCADMIN12-Mar-06 21:20 
AnswerRe: Performance problem when closing the SqlDataReader Pin
cbhkenshin12-Mar-06 22:30
cbhkenshin12-Mar-06 22:30 
GeneralRe: Performance problem when closing the SqlDataReader Pin
CADMIN13-Mar-06 0:56
professionalCADMIN13-Mar-06 0:56 
AnswerRe: Performance problem when closing the SqlDataReader Pin
Mike Dimmick13-Mar-06 1:27
Mike Dimmick13-Mar-06 1:27 
GeneralRe: Performance problem when closing the SqlDataReader Pin
CADMIN13-Mar-06 3:06
professionalCADMIN13-Mar-06 3:06 
QuestionReading binary data Pin
NewbieDude12-Mar-06 19:06
NewbieDude12-Mar-06 19:06 
QuestionHow to execute a complex query in ado? Pin
sting_lee12-Mar-06 16:54
sting_lee12-Mar-06 16:54 
QuestionBinding Controls Problem Pin
nata200612-Mar-06 5:28
nata200612-Mar-06 5:28 
AnswerRe: Binding Controls Problem Pin
cbhkenshin12-Mar-06 22:25
cbhkenshin12-Mar-06 22:25 

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.