小编Ros*_*han的帖子

子查询返回的值超过1.当子查询跟随=,!=,<,<=,>,> =或子查询用作表达式时,不允许这样做

我有一个存储过程select * from book table,使用子查询我的查询是

USE [library]
GO

/****** Object:  StoredProcedure [dbo].[report_r_and_l]    Script Date: 04/17/2013 12:42:39 ******/

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[report_r_and_l]
@fdate date,
@tdate date,
@key varchar(1)
as

if(@key='r')

    select * 
    from dbo.books 
    where isbn =(select isbn from dbo.lending where (act between @fdate and @tdate) and (stat ='close'))

else if(@key='l')

    select * 
    from dbo.books 
    where isbn =(select isbn from dbo.lending where lended_date between @fdate and @tdate)
Run Code Online (Sandbox Code Playgroud)

我知道子查询返回多个查询到主查询,但我不知道如何避免这个错误,任何人都可以帮助我吗?

sql-server subquery

14
推荐指数
2
解决办法
17万
查看次数

如何将数据源绑定到c#中的.rdlc报告

朋友们,我用c#开发了一个简单的应用程序,它有两个rdlc报告

我使用下面的代码将数据源绑定到报表查看器

 this.reportViewer1.LocalReport.ReportPath = @"C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\reports\reports\Report1.rdlc";
 reportViewer1.LocalReport.DataSources.Clear();
 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("customer", dt.Tables[0])) ;
 this.reportViewer1.RefreshReport();
Run Code Online (Sandbox Code Playgroud)

但是当报告生成时,它是空的报告没有数据显示,任何意见???

c# rdlc dataset winforms

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

dataset ×1

rdlc ×1

sql-server ×1

subquery ×1

winforms ×1