
无法将类型“int”隐式转换为“string”
else{DataRowrow=dt.Rows[0];Customercust=newCustomer();cust.Id=(long)row["Id"];cust.Na...
else
{
DataRow row = dt.Rows[0];
Customer cust = new Customer();
cust.Id = (long)row["Id"];
cust.Name = (string)row["Name"];
cust.BrithDay =
(DateTime?)SqlHelper.FromDbValue(row["BrithDay"]);
cust.Address = (string)row["Address"];
cust.CustLevel = (int)row["CustLevel"];这里无法将类型“int”隐式转换为“string”
cust.TelNum = (string)row["TelNum"];
DataRow row = table.Rows[i];
Customer customer = new Customer();
customer.Id = (long)row["Id"];
customer.Name = (string)row["Name"];
customer.BrithDay = (DateTime)SqlHelper.FromDbValue(row["BrithDay"]);
customer.CustLevel = (int)row["CustLevel"];这里无法将类型“int”隐式转换为“string”
customer.TelNum = (string)row["TelNum"];
customer.Address = (string)row["Address"];
customers[i] = customer; 展开
{
DataRow row = dt.Rows[0];
Customer cust = new Customer();
cust.Id = (long)row["Id"];
cust.Name = (string)row["Name"];
cust.BrithDay =
(DateTime?)SqlHelper.FromDbValue(row["BrithDay"]);
cust.Address = (string)row["Address"];
cust.CustLevel = (int)row["CustLevel"];这里无法将类型“int”隐式转换为“string”
cust.TelNum = (string)row["TelNum"];
DataRow row = table.Rows[i];
Customer customer = new Customer();
customer.Id = (long)row["Id"];
customer.Name = (string)row["Name"];
customer.BrithDay = (DateTime)SqlHelper.FromDbValue(row["BrithDay"]);
customer.CustLevel = (int)row["CustLevel"];这里无法将类型“int”隐式转换为“string”
customer.TelNum = (string)row["TelNum"];
customer.Address = (string)row["Address"];
customers[i] = customer; 展开
1个回答
展开全部
你的ClassroomBuilding和 ClassroomStep这两个变量类型都是int类型的,而 buildnum和 floor是string类型的,所以不能这样直接赋值。把这两句改成:
classroom.ClassroomBuilding = int.Parse(buildnum);
classroom.ClassroomStep = int.Parse(floor);
或者将ClassroomBuilding和 ClassroomStep这两个变量类型改成string
请采纳答案,支持我一下。
classroom.ClassroomBuilding = int.Parse(buildnum);
classroom.ClassroomStep = int.Parse(floor);
或者将ClassroomBuilding和 ClassroomStep这两个变量类型改成string
请采纳答案,支持我一下。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询