mchoudhury
Programmer
Hi guys,
I created this new column in my datatable through stored procedure. Inside that column i want to insert value from the code - whats hapeening as i am executing the code when in debug mode the value are being shown (the one to be retrived for the new column).
But i'm having problem in inserting these values into the column on my datatable. How can i write a code that will insert the values into my datatable so when executed these values are shown on the web page:
Public Shared Function getSavings() As DataTable
'
Dim cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "get_Savings"
Dim dr As DataRow
'cmd.Parameters(2).Value = dr.Item(2)
Return getDataTable(cmd)
Stored Proceduer:
SELECT
TS.TelephoneSupplierName, TCP.TelephoneCallPlanName, '' as [AnnualPrice]
FROM tblTelephoneSuppliers TS
INNER JOIN tblTelephoneCallPlans TCP ON TS.TelephoneSupplierID = TCP.TelephoneSupplierID
INNER JOIN tblTelephoneServicePlans TSP ON TCP.TelephoneCallPlanID = TSP.TelephoneCallPlanID
FinalTotal2 = MCLocalTotal + MCNationalTotal + MCTotalCountries + MobileTotal
Public dtSavings As DataTable
dtSavings.Rows(i).Item("AnnualPrice") = (FinalTotal2 * 12)
in debug mode the value of item.array at 3 shows the value of annualprice, but i need to insert that value in the datatable so it can be shown in the web page through datagrid.
Datasource="<%# FRI.SOMB.Visitor.DataProvider.getSavings %>"
<asp:templatecolumn headertext="Annual Price" ItemStyle-BackColor="#66cc33" HeaderStyle-BackColor="#66cc33" HeaderStyle-Font-Bold="True">
<itemtemplate>
<%# DataBinder.Eval(Container.DataItem, "AnnualPrice") %>
</itemtemplate>
</asp:templatecolumn>
Thanks
Mac
I created this new column in my datatable through stored procedure. Inside that column i want to insert value from the code - whats hapeening as i am executing the code when in debug mode the value are being shown (the one to be retrived for the new column).
But i'm having problem in inserting these values into the column on my datatable. How can i write a code that will insert the values into my datatable so when executed these values are shown on the web page:
Public Shared Function getSavings() As DataTable
'
Dim cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "get_Savings"
Dim dr As DataRow
'cmd.Parameters(2).Value = dr.Item(2)
Return getDataTable(cmd)
Stored Proceduer:
SELECT
TS.TelephoneSupplierName, TCP.TelephoneCallPlanName, '' as [AnnualPrice]
FROM tblTelephoneSuppliers TS
INNER JOIN tblTelephoneCallPlans TCP ON TS.TelephoneSupplierID = TCP.TelephoneSupplierID
INNER JOIN tblTelephoneServicePlans TSP ON TCP.TelephoneCallPlanID = TSP.TelephoneCallPlanID
FinalTotal2 = MCLocalTotal + MCNationalTotal + MCTotalCountries + MobileTotal
Public dtSavings As DataTable
dtSavings.Rows(i).Item("AnnualPrice") = (FinalTotal2 * 12)
in debug mode the value of item.array at 3 shows the value of annualprice, but i need to insert that value in the datatable so it can be shown in the web page through datagrid.
Datasource="<%# FRI.SOMB.Visitor.DataProvider.getSavings %>"
<asp:templatecolumn headertext="Annual Price" ItemStyle-BackColor="#66cc33" HeaderStyle-BackColor="#66cc33" HeaderStyle-Font-Bold="True">
<itemtemplate>
<%# DataBinder.Eval(Container.DataItem, "AnnualPrice") %>
</itemtemplate>
</asp:templatecolumn>
Thanks
Mac