如何在三列中连接值并在一个gridview列中显示 [英] How to concatenate values in a three column and display in one gridview column

查看:80
本文介绍了如何在三列中连接值并在一个gridview列中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我一直在桌子上试图解决这个问题,我有一张表[EmployeeInfo],其中包含员工的所有员工信息[如firstnae,lastname,middlename和dob]。我想要做的是显示一个将有5列的gridview。第一列是EmployeeId,第二列是员工的[名字姓氏和中间名]的串联,第三列是员工国籍,最后两列是显示代表的图像的列[更新]和[删除]。



任何关于如何解决这个问题的线索。



谢谢

Hi guys, i have been hitting my head on the desk trying to figure this out, i have a table [EmployeeInfo] that contains all the employee information [like firstnae, lastname, middlename and dob] of the employee. What i want to do is display a gridview that will be having 5 column. The first column will be the EmployeeId, second column will be the concatenation of the employee''s [firstname lastname and middle name], the third column will be the employee nationality and the last two will be a column that displays an image that represent [update] and [delete].

Any clue on how to go about this.

Thanks

推荐答案

hi,





试试此查询,



选择EmployeeID作为EmployeeID,FirstName +''''+ LastName +''''+ MiddleName作为名称,来自EmployeeInfo的国籍





确保firstname,lastname和middlename是否应该是varchar,char,nvarchar等,不应该是数字类型。





问候,

Prakash.T



try this query,

Select EmployeeID as EmployeeID, FirstName + '' '' + LastName + '' '' + MiddleName as Name, Nationality from EmployeeInfo


Make sure whether firstname, lastname and middlename should varchar,char,nvarchar etc., should not numeric types.


Regards,
Prakash.T


这篇关于如何在三列中连接值并在一个gridview列中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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