Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

This is my code:
This is my Procedure
ALTER proc [dbo].[GetTotalDataByIp]
@cntid int,
@checkid int
as
begin
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON;
If(@checkid = 1)
begin

SELECT top(24) LocationName,
COUNT(LocationName) AS TotalCount
FROM
Job WITH (NOLOCK) where CountryId = @cntid and LocationName !=' ' and LocationName !='???'
GROUP BY LocationName ORDER BY TotalCount DESC

end
else if(@checkid = 2)
begin
SELECT top(16) CompanyName,
COUNT(CompanyName) AS TotalCount
FROM
Job WITH (NOLOCK) where CountryId = @cntid and CompanyName != ' ' and isactive=1
GROUP BY CompanyName ORDER BY TotalCount DESC
end
end


I have to import as complex type but only first if condition fields shows only like Locationname and Totalcout.

In my page load I have bind like this...

C#
int getcountry=108;
var getlocationbyip = dc.GetTotalDataByIp(getcountry, 1);
            if (getlocationbyip != null)
            {
                rptgetlocations.DataSource = getlocationbyip;
                rptgetlocations.DataBind();
            }

            //var getcompaniesbyip = dc.getcompaniesbyip(getcountry);
            var getcompaniesbyip = dc.GetTotalDataByIp(getcountry, 2);

            if (getcompaniesbyip != null)
            {
                rptcompanies.DataSource = getcompaniesbyip;
                rptcompanies.DataBind();
            }

I got error when second repeater binding.
Please help me..
Thank you...
Posted
Updated 30-Jun-14 1:37am
v2
Comments
Raul Iloc 4-Jul-14 1:31am    
You must give the complete error details in order to can help you!
NagaRaju Pesarlanka 4-Jul-14 1:36am    
rptcompanies have no matched column for binding......
Torakami 9-Jul-14 8:01am    
Show your aspx page .

1 solution

have a look at this article, it has been given great reviews on the same matter
Returning Multiple Result Sets from an Entity Framework Stored Procedure with Function Import Mappings[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900