0

I'm using to fallback to default image if there is no concrete image for current item. This is working properly for firefox and even for IE8+ but chrome always display default image.

<object style="display: inline-block; width: 226px; height: 340px;" data-bind="attr: { data: ImageUrl }">
    <img style="display: inline-block; width: 226px; height: 340px;" src="~/Content/images/default.png" />
</object>

to be honest I don't know even where to start searching for issue.


I would suggest that you check if the user has already established a connection to the database using the following query

SELECT loginame as LoginName,program_name
FROM sys.sysprocesses 
WHERE db_name(dbid)='my_database'  and loginame='test_user'

If the number of records returned is greater than zero then you can assume that a user has already connected to the database from your application.

If you look at the connection string property in MSDN, you will find the following properties of interest. These 2 properties can be added to your existing connection string to further improve the filters that can be defined in the query above

  • Application Name - The name of the application, or '.Net SqlClient Data Provider' if no application name is provided. (=program_name in the table above)

  • Workstation ID - The name of the workstation connecting to SQL Server. (=hostname in the table above )

I believe that this solution will work irrespective of crashes on the client side and does not require that you save the state in any table.

4

1 に答える 1