Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 21, 2012 10:21 AM by Shailendra Saxena
Nov 16, 2012 06:18 AM|LINK
Is it possible to store session state in SQL Server CE? I was finding any posts about it and didn't get any examples. I develop an asp.net mvc 4 application.
Nov 17, 2012 11:29 AM|LINK
Check following link it may help you
let me know if any query
Nov 18, 2012 03:39 PM|LINK
Standart implementation means that you will use Sql Server as a service. Look at typcal web.config lines:
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
But I want to use SQL Server CE edition, and that means only using local files, there is no url for Sql Server instance. I decided to implement my own SessionStateProvider which should work with SQL Server CE. I have implemented membership and roles
providers and they worked fine. One more remains
Nov 20, 2012 07:05 AM|LINK
Your sqlConnectionString should be "Data Source=|DataDirectory|\Database.sdf"
Nov 20, 2012 09:31 AM|LINK
Yep, I've tried to go by this method, but it doesn't work for me. The error:
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
I used Universal Provides for Sql Server CE, and everything works fine except for the session storing in SqlServer mode. So I decided to implement my own session-state store provider which would work with Sql Ce throughout the Entity Framework. it
Link to msdn about the realization of the provider: http://msdn.microsoft.com/en-us/library/ms178587(v=vs.100).aspx
Nov 21, 2012 10:21 AM|LINK
Sql Server Compact has its own limitations i do not think it is advisable to sotre session state in sql server ce.