从Gridview中的字符串中检索Interger值 [英] Retrieve Interger value from string in a Gridview

查看:101
本文介绍了从Gridview中的字符串中检索Interger值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,
当我将数据插入表dept(100,1,``IT'')中时,以及从两个表emp和dept中获取数据时,记录看起来像下面的网格.

EMpNo DeptNo DeptName
Harshal 1 IT

我的问题是,当我单击网格视图时,所有记录都在受尊重的文本框中显示
但是问题是我得到了除empno之外的所有数据,在这里我以员工姓名而不是我想要Empno的名称获取.请帮助执行此操作

i have a gridview,
when i insert the data into table dept(100,1,''IT'')and when fetch the data from two tables emp and dept the records look like below grid.

EMpNo DeptNo DeptName
Harshal 1 IT

My problem that when i click on a grid view all records shows in respected text boxes
but issue is i got all data except empno here i get as Name of employee instead of name i want to Empno. pl help to do this

推荐答案

TemplateField 中取一个HiddenField 并绑定Empno,然后在选择该行的同时找到HiddedField control及其值并执行您希望从该值中得到什么;

谢谢
Take a HiddenField in a TemplateField and Bind Empno and while selecting the row find HiddedField control and its value and do what you want from that value;

Thanks


要么检查选择查询

在gridview中检查数据字段.
either check the select query
or
check the datafield in gridview.


这篇关于从Gridview中的字符串中检索Interger值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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