General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 18th, 2003, 09:02 AM
bogdip bogdip is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Romania
Posts: 5 bogdip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy DataAdapter.Update() problem

I fill the data set from an Odbc data source (An EXCEL sheet).

Then I want to update the Excel sheet (I made a few changes in my data set).

But, if in the original Excell sheet I have an empty string cell
( the table.row[col]="" ), the odbcDataAdapter.Update() method makes an incorect format Excel sheet. (un unreadable sheet).

I tried to "PrepareForUpdate()" before the odbcDataAdapter.Update() statement but it doesn't work.

private void PrepareForUpdate() {
foreach (DataRow row in table.Rows) {
foreach (DataColumn col in table.Columns ) {
if (row[col].ToString()=="")
row [col]=" "; //System.DBNull.Value;
}
}
}

It doesn't work either if I try to set the value in that cell to a DBNull.Value.

I mention that I use C# in Visual Studio .NET and the Odbc .NET Data Provider from http://msdn.microsoft.com/downloads.

Please, if anyoane has encountered this problem or want to give me a clue don't hesitate 'cause i'm in a desperate situation !

Reply With Quote
  #2  
Old August 18th, 2003, 11:01 PM
pentapenguin pentapenguin is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 51 pentapenguin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 7 sec
Reputation Power: 6
I don't much about Excel in PHP.
I would look at "Advanced PHP for the World Wide Web" by Larry Ullman.
It has some good stuff about Excel and PHP in it.
Hope this helps some....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > DataAdapter.Update() problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT