Tuesday, 20 October 2015

ASP.NET MVC WebGrid Helper

ASP.NET MVC - Get the data from database and display as sort-able grid:

.cshtml page
@{
    var db = Database.Open("tutorial");   // db connection string
    var selectQueryString = "SELECT * FROM students ORDER BY id";   // sort by id by default
    var data = db.Query(selectQueryString);
    var grid = new WebGrid(data);
}

<div id="grid">
    @grid.GetHtml()
</div>


Web config database connection string:
<add name="tutorial" connectionString="Data Source=localhost;Initial Catalog=students;Integrated Security=true;" providerName="System.Data.SqlClient"/>


Tuesday, 6 October 2015

Windows Service Start Failure

After adding the custom service to Windows service list, the service starts but after few seconds, it stops working.

Solution: Application MUST use the Release build rather than debug build.


Analysis Service in Power BI Report Server

 We couldn’t connect to the Analysis Services server. Make sure you’ve entered the connection string correctly... link