Thursday, February 18, 2016

Local DB from SQL Server Command Line Create with EF Conn Strings


Command
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\windows\system32>SqlLocalDb info
Projects
v11.0

C:\windows\system32>SqlLocalDb create "MyInstance"
LocalDB instance "MyInstance" created with version 11.0.

C:\windows\system32>SqlLocalDb start "MyInstance"
LocalDB instance "MyInstance" started.

C:\windows\system32>SqlLocalDb info "MyInstance"
Name:               MyInstance
Version:            11.0.2100.60
Shared name:
Owner:              DoyleJWin7\DoyleJ
Auto-create:        No
State:              Running
Last start time:    2/18/2016 2:57:13 AM
Instance pipe name: np:\\.\pipe\LOCALDB#DCDDFF50\tsql\query

C:\windows\system32>

Attach
<add name="NORTHWNDConnectionString" connectionString="Data Source=(LocalDb)\MyInstance;Initial Catalog=NorthWind;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True"
   providerName="System.Data.SqlClient" />

Use:

<connectionStrings>
  <add name="constring" connectionString="Data Source=(LocalDb)\MyInstance;Initial Catalog=NorthWind;integrated security=true"/>
</connectionStrings>

Monday, February 8, 2016

Disable Visual Studio Auto Update of HTML / MarkUp on Paste with Pesky Tags/Attributes

Here's how to stop the MarkUP and JS Updating by VS.Net on paste of source into IDE:

  MarkUP

  1.  Go to the menu bar and click on 'Tools' and then 'Options'. 
  2.  On the popup screen than appears there is a little checkbox in the lower left corner that says 'Show All Settings'. Make sure that is selected. 
  3.  Expand the 'TextEditor' option and expand the 'HTML' option. 
  4.  Click on 'Miscellaneous' and untick the option 'Auto ID elements on paste in Source view'.
  5.  Click on 'Formatting' and untick the option 'Format on Paste'.
  6.  Click OK and now when you paste any html content or code with the same ID values as what is in your project Visual Studio will not rename the IDs. 
JScript

  1.  Go to the menu bar and click on 'Tools' and then 'Options'. 
  2.  On the popup screen than appears there is a little checkbox in the lower left corner that says 'Show All Settings'. Make sure that is selected.
  3.  Expand the 'TextEditor' option and expand the 'JScript' option. 
  4.  Click on 'Formatting' and untick the option 'Format on Paste'. 
  5.  Click OK and now when you paste any html content or code with the same ID values as what is in your project Visual Studio will not rename the IDs.

Friday, January 29, 2016

Table Expand Collapse Demo : With JQuery Images and Checkboxes

Hello
FYI, here are some examples I have used/seen in past, showing the look and feel of expand / collapse Table columns, this comes in handy when there are allot of columns on a page or users would like to show or hide horizontally

Demos


Expand Collapse Columns using Images


Show Hide Columns using PopUp CheckBoxes


Click the arrow to expand and collapse






View Fiddle Source:






Thursday, January 28, 2016

SQL Server SUPER FAST Generate Script 1.0 : Instead of using SSMS use a script to save heaps of time!

SQL Server SUPER FAST Generate Script 1.0

How many times have you had to get a bunch of sprocs, udf's and views from one DB and need to generate Alter scripts for each only to realize that perusing thru SSMS one at a time or via the Object explorer details even with multi-select can be tedious?

 Well there is an option or 2 that can help!


 Pre Reqs, 

 1. sp_LongPrint.sql You will need the following sproc that prints varchar(max) to the PRINT, else long content is truncated, See attachment

 Option 1: 

Open GetSprocs.Basic.sql, Super Simple, gets sprocs and udfs using INFORMATION_SCHEMA.Routines, Just set the DB to your DB and criteria and boom, it spits out the DDL: ... SELECT r.Routine_Definition, routine_name FROM INFORMATION_SCHEMA.Routines r where ... ... exec master..[sp_LongPrint] @txt ...


 Option 2: 

1. Get vw_DBAObjects.sql run that view to create on target DB,
2. Now open GetSprocs.Advanced.sql, set your DB and criteria, voila u can get VIEWS, Sprocs, UDFS, TVF's DDLs with one click. You can print out 50 views in 1 second!
3. Yay.


 See attached zip for source, uses DB AdventureWorksDW2012 by default Download the Source Here

Tuesday, December 22, 2015

Speed Up Visual Studio 2012 + Build Performance,

Here are 2 recent options that imporved Build (MSBuild) performance: 1): Go to OPTIONS>ENVIRONMENT..under Visual Experience, untick “Use Hardware Graphics Acceleration If Available” for some weird reason your dev environment should loosen / speed straight up. Works on all or our laptops. If you have any doubt if yours is on go slow, op 2) Goto Tools>Options>Environment>Add In Security You will see a checkbox with “allow add in components to load” .Just uncheck it. Restart the IDE and check the lightning speed of the IDE now…

Monday, December 7, 2015

IIS Bindings HTTP and HTTPS, SharePoint 2010 Alternate Access Mapping and SSL

Example binding exposing server to intranet and un-trusted domains in same network, with http and https, Used MS self signing certificate for Dev purposes, Used for reference : This shows IIS8 bindings with various binding to expose a dev server to intranet , also showing corresponding SharePoint 2010 Alternate Access Mappings for bindings to support ssl, and ssl storage of self signed cert and IIS config for SSL cert. In this case using self signed ssl cert for dev / demo purpose only. 1. IIS 8 Bindings
2. SharePoint 2010 Alternate Access Mappings
3. SSL certmgr.msc
4. IIS SSL Config

Friday, December 4, 2015

Code Search Engine : Code.OpenHub

One of the coolest Ive seen in a while Black Duck Open HUB @ http://code.openhub.net/ makes it a breeze to find hard to find code samples, the results are displayed quickly with an intuitive preview interface for quickly checking out result, Break out of the GooglGulag come over to http://code.openhub.net/, Example Search for sharepoint 2010 sandbox solutions yields this: