473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Column Expression helppppppppppppppppp???

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.
Nov 16 '05 #1
5 1465
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" <re*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
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.


Nov 16 '05 #2
The command's SQL dosen't have any refrence to Total column, but I don't why
it still give me error.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:uH**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 16 '05 #3
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" <re*****@hotmail.com> wrote in message
news:Oo*************@tk2msftngp13.phx.gbl...
The command's SQL dosen't have any refrence to Total column, but I don't
why
it still give me error.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:uH**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
> 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.
>
>



Nov 16 '05 #4
The error is SystemException and as follow
"Can not change Read only property for expression column"

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Ok**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oo*************@tk2msftngp13.phx.gbl...
The command's SQL dosen't have any refrence to Total column, but I don't
why
it still give me error.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:uH**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
> 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.
>
>


Nov 16 '05 #5
The error is SystemException and as follow
"Can not change Read only property for expression column"

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Ok**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oo*************@tk2msftngp13.phx.gbl...
The command's SQL dosen't have any refrence to Total column, but I don't
why
it still give me error.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:uH**************@TK2MSFTNGP15.phx.gbl...
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" <re*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
> 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.
>
>


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: GML | last post by:
I have a bound datagrid in C# based on an an SQL query. The results are displayed in a Sharepoint 2003 Webpart. I would like to add a new column based on the results of two columns in the...
4
by: perspolis | last post by:
I have 3 columns in my datatabel name Total,unit,Price. I use a column expression in my project..and in this expression i multiplied two column... for example ...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.