E
evandela
Hi all... this is one part of ASP.net that i just dont understand...
and GOD knows, i am trying.
I have 2 tables, the first one called country [countryID, countryName]
and the second called product[productID, countryID, productName]
I create a datagrid and have to custom write the sql Select command
Up to this point it all works fine... the hitch is that i also want to
be able to update the damned thing... here is the declaration of my
datasource... what do I need to do? please I am a newbie here... so
dont get to technical use easy words and if you have to swear at me,
dont use stars, I am likley going to think that is some sort of
variable and will try use it in some code...
<asp:AccessDataSource ID="countryList" runat="server"
DataFile="~/App_Data/products.mdb"
SelectCommand="SELECT country.*, product.* FROM country, product
WHERE country.countryID = product.countryID;"
ConflictDetection="CompareAllValues"
OldValuesParameterFormatString="original_{0}"
UpdateCommand="UPDATE Product SET [cost]=? WHERE [countryID]=? AND
[productID]=?">
<UpdateParameters>
<asparameter Name="cost" Type="int32" />
<asparameter Name="countryID" Type="int32" />
<asparameter Name="productID" Type="int32" />
</UpdateParameters>
</asp:AccessDataSource>
How does asp.net KNOW what values to put into the update parameters ?
and what do you guys think I am missing here ?
Evan
and GOD knows, i am trying.
I have 2 tables, the first one called country [countryID, countryName]
and the second called product[productID, countryID, productName]
I create a datagrid and have to custom write the sql Select command
Up to this point it all works fine... the hitch is that i also want to
be able to update the damned thing... here is the declaration of my
datasource... what do I need to do? please I am a newbie here... so
dont get to technical use easy words and if you have to swear at me,
dont use stars, I am likley going to think that is some sort of
variable and will try use it in some code...
<asp:AccessDataSource ID="countryList" runat="server"
DataFile="~/App_Data/products.mdb"
SelectCommand="SELECT country.*, product.* FROM country, product
WHERE country.countryID = product.countryID;"
ConflictDetection="CompareAllValues"
OldValuesParameterFormatString="original_{0}"
UpdateCommand="UPDATE Product SET [cost]=? WHERE [countryID]=? AND
[productID]=?">
<UpdateParameters>
<asparameter Name="cost" Type="int32" />
<asparameter Name="countryID" Type="int32" />
<asparameter Name="productID" Type="int32" />
</UpdateParameters>
</asp:AccessDataSource>
How does asp.net KNOW what values to put into the update parameters ?
and what do you guys think I am missing here ?
Evan