|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ! |
|
#2
|
|||
|
|||
|
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.... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > DataAdapter.Update() problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|