tabalinas / jsgrid-webapi

Sample project for jsgrid with WebAPI remote source

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection String .mdf File

andcmill opened this issue · comments

This is the connection string in web.config file
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-JSGridWebAPISample-20150517004842;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-JSGridWebAPISample-20150517004842.mdf" />

I can't seem to find the mdf file referenced AttachDBFilename=|DataDirectory|\aspnet-JSGridWebAPISample-20150517004842.mdf anywhere in the GitHub Repository.

I've managed to update the packages to their intended versions (per the downloaded github project). Now the project will build properly with no errors and run on localhost. The page displayed shows the example grid but says "not found" below. The build is not creating the seeded SQL database on LocalDb. Perhaps I missed a step to get the project running?

Code first (https://github.com/tabalinas/jsgrid-webapi/blob/master/DAL/DataInitializer.cs#L13) resets the data on start. So the table shouldn't be empty. Try to check the DB on start. If data is there, then open Network tab of devtools and see if the request is sent to the backend and has successful response status.

I had to modify the web.config file connection string for my SQL Server LocalDb instance.

Original
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-JSGridWebAPISample-20150517004842;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-JSGridWebAPISample-20150517004842.mdf" />
and
<parameter value="v11.0" />

Modified
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=aspnet-JSGridWebAPISample-20150517004842;Integrated Security=True;AttachDBFilename=|DataDirectory|\aspnet-JSGridWebAPISample-20150517004842.mdf" />
and
<parameter value="MSSQLLocalDB" />

It now builds the database and functions on my machine perfectly.