Skip to main content

Posts

hi..it's me :D

 it's been a long time since my last post i will try to blog again in my journey the journey paths will be in: Blazor, IIS, Crystal Report, SAP Business One, ClickOnce, Nuget, SQL Server Query. most will be using MS tech of course until then
Recent posts

SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

Hi all, Found another repeating issue regarding unable to connect to network SQL Server So here is the step by step i made Enable TCP /IP in SQL Server Configuration Manager Open Port in Window Firewall Enable Allow remote connections to this server in SQL Server Enable SQL Server Browser Service  for step by step with Image please check this link . Credit goes to Pinal Dave

Value cannot be null when trying to get WebAPI Token using Postman

Well, Server Error in '/' Application. Value cannot be null. Parameter name: value Description:  An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:  System.ArgumentNullException: Value cannot be null. Parameter name: value Source Error: Line 431: { Line 432: AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); Line 433: var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); Line 434: AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); Line 435: It happened because when i created the user using Configuration Seed (i'm using EF Code First), i'm not filled the Security Stamp that is why the error occured because when the Security Stamp is null, it

Session timeout problem in IIS

Hi, Long time no post, i will try to post again since i came out searching a typical solution over and over again :D Now i'm gonna post about session. Since i got this from other link so here it is So I started looking into the IIS settings and came to know that i missed two things to change : Application pool’s Idle Time-out (minutes) Session state  – State server’s Time-out (seconds) Once I have changed above settings than after Session timeout worked. So after that I have made one checklist that can help us to validate Session timeout settings, here i am sharing it with you as well so that you will also get some benefits from it : Application Pool  – Advanced Settings Menu – Process Model – Idle Time-out (minutes) Sites –  Session State  – Cookie Settings – Time-out (minutes) If you are using  State Server  or  SQL Server  to manage your session (instead of InProcess), Here is the steps to follow :       Sites – Session State – Session State Mode Settings – Ti

Dropdown List from object List in MVC View

In previous months, i have opportunity to play along with MVC after a while using EF Code First and MVC 5. So today the snippet about creating DropdownList from object List rather than List of SelectListItem let's say u have this Company Class [Key] public int CompanyId { get; set; } public string Name { get; set; } public string Code { get; set; } and u want to display dropdown list based on Code as Text and Id as Value in the View u create a SelectList based on that field @Html.LabelFor(model => model.Brand.Company, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.DropDownList("selectedCompany", Model.Companies.Select(_ => new SelectListItem { Text = _.Code, Value = _.CompanyId.ToString(), Selected = _.CompanyId.ToString() == Model.Brand.Company.CompanyId.ToString() }) ) the Model is a simple ViewModel that have Brands and Brand object sorry for the format, can not make it right :D

sp_msforeachtable - Quick counting table rows

i just starting to play along with SSIS and SSAS and i came up with this trick to show wether my data has been populate into staging or data warehouse table so here is the script EXEC sp_MSForEachTable " DECLARE @count AS INT SET @count=0 SELECT @count = ISNULL(SUM(1), 0) FROM ? PRINT ""?: "" + CONVERT(VARCHAR, @Count) , @whereand = "ORDER BY 1" "  until then

sp_msforeachtable - Delete data in all tables in SQL Server database

hi all, just remember to post this useful tips -- disable all constraints EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" -- delete data in all tables EXEC sp_MSForEachTable "DELETE FROM ?" -- enable all constraints exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all" --if some of the tables have identity columns we may want to reseed them EXEC sp_MSforeachtable "DBCC CHECKIDENT ( '?', RESEED, 0)" see u then