Cannot find data type İNT.

Jun 3, 2016 at 11:22 PM
Hi, i'm getting error :
System.Data.SqlClient.SqlException was unhandled
  Class=16
  ErrorCode=-2146232060
  HResult=-2146232060
  LineNumber=13
  Message=Column, parameter, or variable #9: Cannot find data type İNT.
Parameter or variable '@GatheredSP' has an invalid data type.
  Number=2715
  Procedure=tr_dbo__Guild_4188f2eb-5e9c-4802-a1dd-4acd71765a47
  Server=185.103.196.233
  Source=.Net SqlClient Data Provider
  State=3
  StackTrace:
       konum: System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       konum: System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       konum: System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       konum: System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       konum: System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       konum: System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       konum: System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       konum: TableDependency.SqlClient.SqlTableDependency`1.CreateDatabaseObjects(String connectionString, String tableName, String databaseObjectsNaming, IEnumerable`1 userInterestedColumns, String tableColumns, String selectColumns, String updateColumns)
       konum: TableDependency.SqlClient.SqlTableDependency`1.CreateDatabaseObjects(String connectionString, String tableName, String dataBaseObjectsNamingConvention, IEnumerable`1 userInterestedColumns, IList`1 updateOf, Int32 timeOut, Int32 watchDogTimeOut)
       konum: TableDependency.TableDependency`1.Start(Int32 timeOut, Int32 watchDogTimeOut)
       konum: TableDependency.SqlClient.SqlTableDependency`1.Start(Int32 timeOut, Int32 watchDogTimeOut)
       konum: Lucy.Program.Main(String[] args) D:\Google Drive\VisualStudioProjects\VisualProjects\Lucy\Lucy\Program.cs içinde: satır 48
       konum: System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       konum: System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       konum: System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       konum: System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       konum: System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       konum: System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       konum: System.Activator.CreateInstance(ActivationContext activationContext)
       konum: Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       konum: System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       konum: System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       konum: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       konum: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       konum: System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
public class _Guild
{
    public int id { get; set; }
    public string Name { get; set; }
    public int GatheredSP { get; set; }
}
/****** Object:  Table [dbo].[_Guild]    Script Date: 04.06.2016 02:22:17 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[_Guild](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Name] [varchar](64) NOT NULL,
    [Lvl] [tinyint] NOT NULL,
    [GatheredSP] [int] NOT NULL,
    [FoundationDate] [smalldatetime] NOT NULL,
    [Alliance] [int] NULL,
    [MasterCommentTitle] [varchar](129) NULL,
    [MasterComment] [varchar](2049) NULL,
    [Booty] [int] NULL,
    [Gold] [bigint] NOT NULL CONSTRAINT [DF___Guild__Gold__064DE20A]  DEFAULT ((0)),
    [LastCrestRev] [int] NOT NULL CONSTRAINT [DF___Guild__LastCres__6C43F744]  DEFAULT ((0)),
    [CurCrestRev] [int] NOT NULL CONSTRAINT [DF___Guild__CurCrest__6D381B7D]  DEFAULT ((0)),
    [MercenaryAttr] [tinyint] NOT NULL CONSTRAINT [DF___Guild__Mercenar__72F0F4D3]  DEFAULT ((0)),
 CONSTRAINT [PK__Guild] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY],
 CONSTRAINT [IX__Guild] UNIQUE NONCLUSTERED 
(
    [Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[_Guild]  WITH CHECK ADD  CONSTRAINT [FK__Guild__AlliedClans] FOREIGN KEY([Alliance])
REFERENCES [dbo].[_AlliedClans] ([ID])
GO

ALTER TABLE [dbo].[_Guild] CHECK CONSTRAINT [FK__Guild__AlliedClans]
GO
Coordinator
Jun 4, 2016 at 7:43 AM
Hi

In this case because there is not matching between model property and database column name, you have to use the MAPPER:
        private static void Main()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;

            var mapper = new ModelToTableMapper<_Guild>();
            mapper.AddMapping(c => c.id, "ID");

            using (var tableDependency = new SqlTableDependency<_Guild>(connectionString, "[_Guild]", mapper))
            {
                tableDependency.OnChanged += TableDependency_Changed;

                tableDependency.Start();
                Console.WriteLine(@"Waiting for receiving notifications...");
                Console.WriteLine(@"Press a key to stop");
                Console.ReadKey();
                tableDependency.Stop();
            }
        }

        private static void TableDependency_Changed(object sender, RecordChangedEventArgs<_Guild> e)
        {
            Console.WriteLine(Environment.NewLine);

            if (e.ChangeType != ChangeType.None)
            {
                var changedEntity = e.Entity;
                Console.WriteLine(@"DML operation: " + e.ChangeType);
                Console.WriteLine(@"ID: " + changedEntity.id);
                Console.WriteLine(@"Name: " + changedEntity.Name);
            }
        }
Jun 4, 2016 at 9:08 AM
var mapper = new ModelToTableMapper<_Guild>();
mapper.AddMapping(c => c.id, "ID");
var dep = new SqlTableDependency<_Guild>(connectionString, "dbo._Guild");
dep.OnChanged += onChanged;
dep.Start();
Doesn't work.

Additional information: Column, parameter, or variable #9: Cannot find data type İNT.

Parameter or variable '@GatheredSP' has an invalid data type.
Jun 4, 2016 at 9:19 AM
Problem is INT types. I tried:
    {
        public int id { get; set; }
        public string Name { get; set; }
        public string MasterCommentTitle { get; set; }
        //public int GatheredSP { get; set; }
    }
work perfectly!
Coordinator
Jun 4, 2016 at 3:39 PM
ISSUE fixed with version 4.5.8.0