【发布时间】:2017-04-10 04:10:59
【问题描述】:
我正在使用char,但我很困惑,因为我知道我必须将此char 转换为string 数据类型。
else if (mode.Equals("Update"))
{
char id = char.Parse(txtuserId.Text.ToString()); //conversion as i told before
string newName = txtname.Text;
string newemail = txtemail.Text;
string newpassword = txtpassword.Text;
string newaddress = rtbaddress.Text;
string newphoneNumber = txtphoneNumber.Text;
string newroleName = cmbrole.Text;
users updatedusers = (
from x in db.users
where x.id==id // THE WRONG ONE
select x
).First();
}
【问题讨论】:
-
尝试在 x.id 中添加 .tostring
-
字符串id =txtuserId.Text;
-
表中
id的列类型是什么users -
@EarvinNillCastillo:x.id.ToString = id 在哪里?仍然错误..
-
@ManishSingh 如果我使用字符串 id =txtuserId.Text,表中的数据必须是字符串。但要求是字符..
标签: c# string char type-conversion