变量名称带有空格

rtp*_*rtp -5 c# linq asp.net gridview

我想要一个带有空格的变量名.我将此集合传递给gridview,我需要标题有一个空格而不是下划线

var registrationReport = (from r in BankMedEntity.Customers
                      select new {r.Id,Customer Type =  r.CustomerType_Id });
Run Code Online (Sandbox Code Playgroud)

有关如何实现这一点的任何想法?

我需要将标题设为"客户类型"而不是"CustomerType_Id"

Ash*_*ngh 5

你不能,c#不允许变量名中的空格.它们将被视为不同的单词,编译器将会出现"啊......你的意思是什么?"