Search Results

Search found 4 results on 1 pages for 'haxelit'.

Page 1/1 | 1 

  • Castle Windsor Dynamic Property in XML config

    - by haxelit
    I'm trying to set the DataContext on ApplicationMainWindow which is a WPF window. When I set it up in the XML like so it leaves the DataContext null: <!-- View Models --> <component id="mainwindow.viewmodel" type="ProjectTracking.ApplicationMainViewModel, ProjectTracking" inspectionBehavior="none" lifestyle="transient"> </component> <!-- UI Components --> <component id="mainwindow.view" type="ProjectTracking.ApplicationMainWindow, ProjectTracking" inspectionBehavior="none" lifestyle="transient"> <parameters> <DataContext>${mainwindow.viewmodel}</DataContext> </parameters> </component> But if I do it this way via C# it works. _Kernel.Register( ... Component.For<ApplicationMainWindow>() .DynamicParameters( (k,d) => { d["DataContext"] = k[typeof(ApplicationMainViewModel)]; }) ); I'm instantiating my window like so: Window window = _Kernel[typeof(ApplicationMainWindow)] as Window; When I configure windsor via the xml config it leaves my DataContext NULL, but when I configure it via code it works like a charm. Do I need to use code to pull this off, or should it work via XML config ? Thanks, Raul

    Read the article

  • GetOleDbSchemaTable Foreign Keys on Sql Server 2005

    - by haxelit
    I'm trying to get the Foreign Keys for a table in my SQL Server 2005 database. I'm using the GetOleDbSchemaTable function right now: DataTable schemaTable = connection.GetOleDbSchemaTable( OleDbSchemaGuid.Foreign_Keys, new object[] { null, null, null, "TABLE" }); This pulls back the right foreign keys, the only problem is that the UpdateRule and DeleteRule are set to "No Action". If I browse to the same table in SSMS I can see that my DeleteRule is "Set NULL". Does the GetOleDbSchemaTable function not return the proper foreign key rules ? Has any one else ran into this problem ?

    Read the article

  • SQL Server catch error from extended stored procedure

    - by haxelit
    Hello I have an extended stored procedure that sends an error message. srv_sendmsg(pSrvProc, SRV_MSG_ERROR, errorNum, SRV_FATAL_SERVER, 1, NULL, 0, (DBUSMALLINT) __LINE__, buff, SRV_NULLTERM); I've set the severity to SVR_FATAL_SERVER just as a test to see if I can cause the message to throw an exception in the sql. In my SQL i'm doing: BEGIN TRY EXEC dbo.xp_somethingCool SET @Error = @@ERROR END TRY BEGIN CATCH PRINT 'AN Error occoured!' SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_MESSAGE() AS ErrorMessage; END CATCH I would think that when my xp sends the error message the tsql would catch the error and select the error_number and error_message. Instead what ends up happening is that the xp sends the message and the T-SQL continues on its way like nothing happened. The @@Error variable doesn't get set either. So I was wondering if there was any trick to getting SQL to catch an error from an XP ? Thanks, Raul

    Read the article

  • WCF Multiple contracts with duplicate method names

    - by haxelit
    Hello, I have a service with multiple contracts like so. [ServiceContract] public partial interface IBusinessFunctionDAO { [OperationContract] BusinessFunction GetBusinessFunction(Int32 businessFunctionRefID); [OperationContract] IEnumerable<Project> GetProjects(Int32 businessFunctionRefID); } [ServiceContract] public partial interface IBusinessUnitDAO { [OperationContract] BusinessUnit GetBusinessUnit(Int32 businessUnitRefID); [OperationContract] IEnumerable<Project> GetProjects(Int32 businessUnitRefID); } I then explicitly implemented each one of the interfaces like so. public class TrackingTool : IBusinessFunctionDAO, IBusinessUnitDAO { BusinessFunction IBusinessFunctionDAO.GetBusinessFunction(Int32 businessFunctionRefID) { // implementation } IEnumerable<Project> IBusinessFunctionDAO.GetProjects(Int32 businessFunctionRefID) { // implementation } BusinessUnit IBusinessUnitDAO.GetBusinessUnit(Int32 businessUnitRefID) { // implementation } IEnumerable<Project> IBusinessUnitDAO.GetProjects(Int32 businessUnitRefID) { // implementation } } As you can see I have two GetProjects(int) methods, but each one is implemented explicitly so this compiles just fine and is perfectly valid. The problem arises when I actually start this as a service. It gives me an error staying that TrackingTool already contains a definition GetProject. While it is true, it is part of a different service contract. Does WCF not distinguish between service contracts when generating the method names ? Is there a way to get it to distinguish between the service contracts ? My App.Config looks like this <service name="TrackingTool"> <endpoint address="BusinessUnit" contract="IBusinessUnitDAO" /> <endpoint address="BusinessFunction" contract="IBusinessFunctionDAO" /> </service> Any help would be appreciated. Thanks, Raul

    Read the article

1