Datasource doesn't generate data

S

sck10

Hello,

I have two datasources. The first one pulls data from a Stored Procedure.
The second one from an SQL String. They both get there parameter value from
a GridView (ControlID="gvSearchList"). I've tested the stored procedure
datasource when building it (putting in an example for the 2nd paramater)
with the correct results. However, when I bind a GridView to it, nothing
shows, but if I bind it to the second datasource, the GridView shows data.
Any help would be appreciated.
--
Thanks in advance,

sck10



Stored Procedure Data Source
--------------------------------
<asp:SqlDataSource ID="dsCustRevList" runat="server"
ConnectionString="<%$ ConnectionStrings:cnnFundTrack %>"
SelectCommand="sproc_web_ServicePortfolio"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:parameter DefaultValue="FindPortfolioCustomerRevenueOne"
Name="strParm01" Type="String" />
<asp:ControlParameter ControlID="gvSearchList"
DefaultValue="NoParameter" Name="strParm02" PropertyName="SelectedValue"
Type="String" />
<asp:parameter Name="strParm03" Type="String" />
<asp:parameter Name="strParm04" Type="String" />
</SelectParameters>
</asp:SqlDataSource>


SQL DataSource
------------------
<asp:SqlDataSource ID="dsCustRevListQuery" runat="server"
ConnectionString="<%$ ConnectionStrings:cnnFundTrack %>"
SelectCommand="
SELECT
CustomerRevenue_ID,
ServiceName,
Customer,
Region,
RevenueQtr01 + RevenueQtr02 + RevenueQtr03 + RevenueQtr04,
RevenueImpactType,
RevenueYear,
AnnualForecastRevenue
FROM tblServicePortfolio_Customer_Revenue
WHERE (ServiceName = @ServiceName)
ORDER BY RevenueYear DESC, Customer, Region, RevenueImpactType">
<SelectParameters>
<asp:ControlParameter
ControlID="gvSearchList"
DefaultValue="NoParameter"
Name="ServiceName"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
W

Walter Wang [MSFT]

Hi,

Thank you for posting!

After reviewing the problem description, I am not clear on some points.
Could you please help me on the following questions so that we can work
more closely?

1) It seems the Stored Procedure has 4 parameters, but only strParm01 and
strParm02 have DefaultValue defined. Do we have default value defined in
the Stored Procedure for strParam03 and strParam04?
2) For strParam02, by setting DefaultValue to 'NoParameter', will it
produce any result?

I would suggest you to try a more simpler Stored Procedure first to see if
it works.

If there is any something you like to add, please feel free to reply here.
I am glad
to work with you on it.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top