Implicit conversions from 'String' to 'Char?' RRS feed

  • Question

  • I'm new to LINQ & VB.

    I have a VARCHAR(MAX),NULL field, and i use SPROC to Insert/Update/Delete data. 

    The code generated by LINQ to SQL ORM designer however, produce this error (underlined):

    Compiler Error Message: BC30512: Option Strict On disallows implicit conversions from 'String' to 'Char?'.

    Source Error:

    Line 78: Line 79: Private Sub InsertAnnouncement(ByVal obj As Announcement) Line 80: Me.spAnnouncements_Insert(obj.subject, CType(obj.expireDate,System.Nullable(Of Date)), obj.announcement, obj.dbuser, CType(obj.applicationID,System.Nullable(Of System.Guid)), obj.projectNo) Line 81: End Sub Line 82: 

    Any help, in full answer or link to other solution is appreciated.

    Thanks & Happy 2009.
    Wednesday, December 31, 2008 7:28 AM


  • You need to make sure that when you map the stored procedure that's going to be used for insert/update/delete into a method on your DataContext that the parameter types are mapped to match the corresponding property types of your entity.
    Wayward LINQ Lacky
    • Marked as answer by Max Prime Saturday, January 3, 2009 6:24 AM
    Wednesday, December 31, 2008 7:16 PM