Column Expression helppppppppppppppppp???

  • Thread starter Thread starter perspolis
  • Start date Start date
P

perspolis

hi everyone
I used a column expression like "UnitPrice*Quantity" for a cloumn named
Total.
but when I want to update my dataset by SqlDataAdopter, it gives me error.
The column Total is just for showing "UnitPrice*Quantity" not for
inserting in database,but I don't know why it gives me SystemException
error.
When I remove column expression and calculate "UnitPrice*Quantity"
programmatically ,it works well.
 
Hi,

What if you configure the SqlDataAdapter's InsertCommand with a manually
created SqlCommand which would just disregard the calculated column?
I mean the command's SQL statement will in no way reference the Total
column - can this help?
 
The command's SQL dosen't have any refrence to Total column, but I don't why
it still give me error.
Dmitriy Lapshin said:
Hi,

What if you configure the SqlDataAdapter's InsertCommand with a manually
created SqlCommand which would just disregard the calculated column?
I mean the command's SQL statement will in no way reference the Total
column - can this help?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

perspolis said:
hi everyone
I used a column expression like "UnitPrice*Quantity" for a cloumn named
Total.
but when I want to update my dataset by SqlDataAdopter, it gives me error.
The column Total is just for showing "UnitPrice*Quantity" not for
inserting in database,but I don't know why it gives me SystemException
error.
When I remove column expression and calculate "UnitPrice*Quantity"
programmatically ,it works well.
 
What's the error?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
perspolis said:
The command's SQL dosen't have any refrence to Total column, but I don't
why
it still give me error.
Dmitriy Lapshin said:
Hi,

What if you configure the SqlDataAdapter's InsertCommand with a manually
created SqlCommand which would just disregard the calculated column?
I mean the command's SQL statement will in no way reference the Total
column - can this help?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

perspolis said:
hi everyone
I used a column expression like "UnitPrice*Quantity" for a cloumn named
Total.
but when I want to update my dataset by SqlDataAdopter, it gives me error.
The column Total is just for showing "UnitPrice*Quantity" not for
inserting in database,but I don't know why it gives me SystemException
error.
When I remove column expression and calculate "UnitPrice*Quantity"
programmatically ,it works well.
 
The error is SystemException and as follow
"Can not change Read only property for expression column"

Dmitriy Lapshin said:
What's the error?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
perspolis said:
The command's SQL dosen't have any refrence to Total column, but I don't
why
it still give me error.
in message news:[email protected]...
Hi,

What if you configure the SqlDataAdapter's InsertCommand with a manually
created SqlCommand which would just disregard the calculated column?
I mean the command's SQL statement will in no way reference the Total
column - can this help?

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

hi everyone
I used a column expression like "UnitPrice*Quantity" for a cloumn named
Total.
but when I want to update my dataset by SqlDataAdopter, it gives me error.
The column Total is just for showing "UnitPrice*Quantity" not for
inserting in database,but I don't know why it gives me SystemException
error.
When I remove column expression and calculate "UnitPrice*Quantity"
programmatically ,it works well.
 
Back
Top