【问题标题】:integer datatype not work in linq to sql整数数据类型在 linq to sql 中不起作用
【发布时间】:2011-03-15 07:27:18
【问题描述】:

亲爱的朋友们 我面临一个问题,如果我在 Integer 的 sql 服务器中创建一个数据类型,然后在 linq to sql 查询中使用它,它会给出“特定转换无效”的错误,当我将数据类型更改为 varchar 时,linq to sql 查询工作正常

一件事如何使用linq to sql查询制作水晶报表

【问题讨论】:

  • 您能否在问题中包含代码示例?

标签: vb.net linq-to-sql crystal-reports


【解决方案1】:

听起来它不能转换 system.integer 类型。改用 System.int32 类型,它在 linq sql type mapping 期间转换为 sql int。

【讨论】:

    【解决方案2】:
    'Dim addvou As New vr_detail With {.ac_no = DataGridView1.Rows(abcd).Cells(0).Value, .name = DataGridView1.Rows(abcd).Cells(1).Value, .credit = DataGridView1.Rows(abcd).Cells(3).Value, .cust_no = TextBox9.Text, .debit = DataGridView1.Rows(abcd).Cells(2).Value, .vend_no = TextBox2.Text, .vr_date = DateTimePicker1.Text, .vr_no = TextBox1.Text, .post_date = DateTimePicker3.Text, .vr_type = ComboBox1.Text, .sub_ac = DataGridView1.Rows(abcd).Cells(4).Value, .head_ac = DataGridView1.Rows(abcd).Cells(5).Value, .main_ac = DataGridView1.Rows(abcd).Cells(6).Value}
    
                voucher.vr_details.InsertOnSubmit(addvou)
                voucher.SubmitChanges()'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      相关资源
      最近更新 更多