PC Review


Reply
Thread Tools Rate Thread

AdomdCommand with a DataTable with DBNulls causing problems.

 
 
Nestor
Guest
Posts: n/a
 
      28th Feb 2008
The following code would fail, with the error:

"The '' string cannot be converted to the double type."

when trainTable contains rows with DBNull in some of the columns.
How can I pass NULL to MSAS?

using (AdomdCommand comm = connAS.CreateCommand())
{
comm.CommandText = "INSERT INTO MINING MODEL [MyModel]
([statbbrev],[lpop],[ldem],[lemp]) @TrainTable";
comm.Parameters.Add("TrainTable", trainTable);
comm.ExecuteNonQuery();
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with AdomdCommand when Passing DataTable with DBNull's Nestor Microsoft ADO .NET 3 5th Mar 2008 12:07 PM
Problem with AdomdCommand with passing DataTable with DBNull in some cells Nestor Microsoft ADO .NET 2 28th Feb 2008 02:59 PM
Filling a DataTable causing RowState to change in another table michael Microsoft ADO .NET 4 23rd Feb 2008 03:31 PM
What could be causing this while updating a DataTable? Benton Microsoft ADO .NET 2 2nd Feb 2006 10:12 PM
Prepared statement for Adomdcommand Rujuta Gandhi Microsoft C# .NET 0 9th Feb 2005 07:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:07 AM.