Groups | Blog | Home
all groups > dotnet ado.net > february 2008 >

dotnet ado.net : Problem with AdomdCommand with passing DataTable with DBNull in some cells


Cor Ligthert[MVP]
2/27/2008 12:00:00 AM
One time is enough, this is really no second reply service.

Nestor
2/27/2008 7:57:16 PM
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();
}
Nestor
2/28/2008 9:59:08 AM
Sorry, it was a mistake.

[quoted text, click to view]
AddThis Social Bookmark Button