相同的退货类型?数据集& SqlDataReader的 [英] same return types ? DataSet & SqlDataReader

查看:58
本文介绍了相同的退货类型?数据集& SqlDataReader的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不可能吗?


公共DataSet getDimensions()

{

}


public SqlDataReader getDimensions()

{

}


我在编译时收到此错误:" ;类''ProductFamily''已经定义了一个名为''getDimensions'的成员名为''getDimensions'',参数类型相同


- 对我来说似乎不对 -

Hi, is this not possible?

public DataSet getDimensions()
{
}

public SqlDataReader getDimensions()
{
}

I get this error on compile: "Class ''ProductFamily'' already defines a
member called ''getDimensions'' with the same parameter types"

-- Doesnt seem right to me --

推荐答案

Adie< ar ******* @ hotmail.com>写道:
Adie <ar*******@h-o-t-m-a-i-l.com> wrote:
这不可能吗?


No.

public DataSet getDimensions()


公共SqlDataReader getDimensions()
{
}

我在编译时遇到这个错误:Class'ProductFamily''已经定义了一个名为''getDimensions''的成员参数类型

- 似乎对我不对 -
Hi, is this not possible?
No.
public DataSet getDimensions()
{
}

public SqlDataReader getDimensions()
{
}

I get this error on compile: "Class ''ProductFamily'' already defines a
member called ''getDimensions'' with the same parameter types"

-- Doesnt seem right to me --




为什么不呢?在这种情况下你会期望被叫哪个:


对象o = getDimensions();


甚至只是
< br $>
getDimensions();





-

Jon Skeet - < ; sk *** @ pobox.com>
http://www.pobox .com / ~siget

如果回复小组,请不要给我发邮件



Why not? Which would you expect to be called in this case:

object o = getDimensions();

or even just

getDimensions();

?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Jon Skeet [C#MVP]写道:
Jon Skeet [C# MVP] wrote:
Adie< ar ******* @ hotmail.com>写道:
Adie <ar*******@h-o-t-m-a-i-l.com> wrote:
这不可能吗?






No.

public DataSet getDimensions()
{
}
公共SqlDataReader getDimensions()


我在编译时收到此错误:Class 'ProductFamily''已经定义了一个名为''getDimensions''的成员,其参数类型相同

- 对我来说似乎不对 -
public DataSet getDimensions()
{
}

public SqlDataReader getDimensions()
{
}

I get this error on compile: "Class ''ProductFamily'' already defines a
member called ''getDimensions'' with the same parameter types"

-- Doesnt seem right to me --



为什么不呢?在这种情况下你会期望被称为:

对象o = getDimensions();

甚至只是

getDimensions();



Why not? Which would you expect to be called in this case:

object o = getDimensions();

or even just

getDimensions();




我的印象是我可以在返回类型上超载


DataSet ds = getDimensions()

SqlDataReader dr = getDimensions()



I was under the impression that I could overload on return type

DataSet ds = getDimensions()
SqlDataReader dr = getDimensions()


Adie< ar ******* @ hotmail.com>写道:
Adie <ar*******@h-o-t-m-a-i-l.com> wrote:
我的印象是我可以在返回类型上重载

DataSet ds = getDimensions()
SqlDataReader dr = getDimensions()
I was under the impression that I could overload on return type

DataSet ds = getDimensions()
SqlDataReader dr = getDimensions()




不,你不能。


-

Jon Skeet - < sk ** *@pobox.com>
http://www.pobox.com/~双向飞碟

如果回复小组,请不要给我发邮件



No, you can''t.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


这篇关于相同的退货类型?数据集&amp; SqlDataReader的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆