0
我用这个代码有效:是指在数据库整数指定的强制转换中的LINQ to SQL
int i = Int32.Parse(dataGridView2.Rows[rowID].Cells["ProfID"].Value.ToString());
var db = new bouDataDataContext();
var sel = db.Payments.Where(c => c.WTID == wtID && c.ProfID == i).Single();
和c.WTID
但我收到此错误:
specified Cast is not a valid
什么是'wtID'? –
wtID是整数 –
Payments类中定义的WTID和ProfID的类型是什么? – zsong