在c#中“ <>” 代表什么意思?

xiaomianmao 2008-06-09 11:50:30
private void FillComboBox0()
{
string line;
int ni;

ni = fields.Length/3;

this.comboBox0.Items.Clear();
for(int i = 0; i< ni; i++ ) { line = fields[i,0]; this.comboBox0.Items.Add(line); }
this.comboBox0.SelectedIndex = 0;
}

private void FillComboBox(int k)
{
string line;
DataTable dt;
int ni;

if (k==2) dds = initSys.ws.GetMaterielPDMList(tj1);
// if (k==3) dds = initSys.ws.GetMaterielPZVList(tj2);
if (k==4) dds = initSys.ws.GetMaterielPDMList("type <> '1'");
// if (k==5) dds = initSys.ws.GetMaterielPZVList(tj3);

if (dds != null)
{
dt = dds.Tables[0];
ni = dt.Rows.Count;

if (k==2) this.comboBox2.Items.Clear();
// if (k==3) this.comboBox3.Items.Clear();
if (k==4) this.comboBox4.Items.Clear();
// if (k==5) this.comboBox5.Items.Clear();

if ( ni>0)
{
for(int i = 0; i< ni; i++ )
{
line = dt.Rows[i].ItemArray[0].ToString().Trim();
if (k==2) this.comboBox2.Items.Add(line);
// if (k==3) this.comboBox3.Items.Add(line);
if (k==4) this.comboBox4.Items.Add(line);
// if (k==5) this.comboBox5.Items.Add(line);
}
if (k==2 && this.comboBox2.Items.Count == 1) this.comboBox2.SelectedIndex=0;
// if (k==3 && this.comboBox3.Items.Count == 1) this.comboBox3.SelectedIndex=0;
if (k==4 && this.comboBox4.Items.Count == 1) this.comboBox4.SelectedIndex=0;
// if (k==5 && this.comboBox5.Items.Count == 1) this.comboBox5.SelectedIndex=0;
}
}
else initSys.TS_MessageBox("数据库访问错误!");
}
看不懂这段程序
...全文
1204 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
chengluxiao 2012-07-19
  • 打赏
  • 举报
回复
上面已经说的很清楚啦
ai7bin 2011-05-11
  • 打赏
  • 举报
回复
学习
xuebin_hu 2008-06-10
  • 打赏
  • 举报
回复
没看懂意思,
不过除了泛型,或者SQL语句,不可能有其他!
不然就错了!
Hesperus 2008-06-10
  • 打赏
  • 举报
回复
SQL语句,不等于吧
最好看看initSys.ws.GetMaterielPDMList这个方法的代码
fengweizhijie 2008-06-10
  • 打赏
  • 举报
回复
同意楼上:
("type <> '1'")表示
type不等于'1'
vfan2010 2008-06-10
  • 打赏
  • 举报
回复
在LZ的代码中,应该按照SQL中<>来理解,表示不等于
wlovew 2008-06-10
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 liyong11111 的回复:]
引用 7 楼 tinalucky 的回复:
就你的代码,那是表示不等于的意思。
还有另一个意思,在 <>之间加入类型参数,如 <int>,这是有关泛型方面的知识。
[/Quote]
fanjie51 2008-06-10
  • 打赏
  • 举报
回复
有两种,一种是不等于,一种表示泛型,学习中.
liyong11111 2008-06-10
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 tinalucky 的回复:]
就你的代码,那是表示不等于的意思。
还有另一个意思,在 <>之间加入类型参数,如 <int>,这是有关泛型方面的知识。
[/Quote]
涛声宜旧 2008-06-10
  • 打赏
  • 举报
回复
type <> '1'是传入的字符串参数,是SQL语句的一部分
zspsys 2008-06-10
  • 打赏
  • 举报
回复
有两种,一种是不等于,一种表示泛型
tinalucky 2008-06-10
  • 打赏
  • 举报
回复
就你的代码,那是表示不等于的意思。
还有另一个意思,在<>之间加入类型参数,如<int>,这是有关泛型方面的知识。
simonllf 2008-06-10
  • 打赏
  • 举报
回复
主要把数据通过this.comboBox0.Items.Add(line); 来添加到下拉框中。其他就是对相关数据进行操作咯,还有那个<>没什么,initSys.ws.GetMaterielPDMList("type <> '1'"); 中是GetMaterielPDMList这个方法的一个字串参数
ws_hgo 2008-06-10
  • 打赏
  • 举报
回复
具体点
smallfz 2008-06-10
  • 打赏
  • 举报
回复
这句么?if (k==4) dds = initSys.ws.GetMaterielPDMList("type <> '1'");

是sql语句的一部分吧,<>表示不等于
vising 2008-06-10
  • 打赏
  • 举报
回复
泛型
具体请看http://book.csdn.net/bookfiles/30/10030857.shtml
zhangyu_xl 2008-06-10
  • 打赏
  • 举报
回复
泛型吧
fuadam 2008-06-09
  • 打赏
  • 举报
回复
哪句不懂

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧