Subscribe and Follow

Next Move Android- M

Android- M   Features The Mountain View company also released the new Android M developer preview, just like how Android Lollipop was...

Android- M  Features

The Mountain View company also released the new Android M developer preview, just like how Android Lollipop was released as Android L at last year's I/O conference. Similarly, the official name of the new OS version will only be revealed at the time of the next Nexus device launch, expected in October. Google also stressed that for Android M, the company has focused on improving the core experience of Android and has made some changes to the fundamentals of the platform apart from fixing several bugs. During the Google I/O keynote, the company also revealed that this time it will provide a clear timeline for Android M Developer Preview for testing and feedback to the preview build.


Dim3 Technology And solution
  1. App Links
  2. Web Experience
  3. Mobile Payments
  4. Fingerprint Support
  5. New RAM manager
  6. Adoptable Storage Devices
  7. Auto Backup and Restore for Apps


0 comments:

ASP .Net 5 Framework features

           Asp DotNet 5 New fetures ASP.NET 5 includes frameworks for building Web apps and services such as MVC, Web API, Web Pages...


           Asp DotNet 5 New fetures

ASP.NET 5 includes frameworks for building Web apps and services such as MVC, Web API, Web Pages (coming in a future release), SignalR and Identity. Each of these frameworks has been ported to work on the new HTTP request pipeline and has been built to support running on the .NET Framework, .NET Core or cross-platform.
Today, the existing implementations of MVC, Web API and Web Pages share many concepts and duplicate abstractions, but share very little in the way of actual implementation. As part of porting these frameworks to ASP.NET 5, Microsoft decided to take a fresh look at combining these frameworks into a single unified Web stack. ASP.NET MVC 6 takes the best of MVC, Web API and Web Pages and combines it into a single framework for building Web UI and Web APIs. This means from a single controller you can just as easily render a view as return formatted data based on content negotiation.
In addition to unification, ASP.NET MVC 6 introduces a host of new features:
  • Built-in DI support
  • Ability to create controllers from any class—no base class required
  • Action-based request dispatching
  • View Components—a simple replacement for child actions
  • Routing improvements, including simplified attribute routing
  • Async views with flush points
  • Ability to inject servers and helpers into views using @inject
  • ViewStart inheritance
  • Tag helpers
You can find more information and samples at github.com/aspnet/mvc.
Web Forms isn’t available on ASP.NET 5, but is still fully supported on the .NET Framework. There are a number of important new features coming to Web Forms in the upcoming version of the .NET Framework, including support for HTTP 2.0, async model binding and a Roslyn-based CodeDom provider. We’re also working on various features reminiscent of Web Forms in MVC 6, such as tag helpers and other Razor improvements.




0 comments:

Macro In Visual Studio

Macro Used In Visual studio There are many tasks that we do in Visual Studio that are repetitive and which can be automated using macros...

Macro Used In Visual studio


There are many tasks that we do in Visual Studio that are repetitive and which can be automated using macros. One such example is attaching to process for debugging. Having the ability to debug an existing running process (Ex: Process of a .net console application exe) is a common requirement. The usual way would be using the Attach To Process window from Debug -> Attach To Process in Visual Studio. But this can become cumbersome and irritating if we have to do it again and again to test iterative changes. This is where macros come to our rescue.


 We want to debug from the second breakpoint by attaching to this process so, Now we start recording our macro in 5 simple steps –

 Click Record Temporary Macro from the Tool -> Macros menu as shown below:


Recording is started. Now perform the necessary actions to attach to the process as below:

Click Debug -> Attach to Process

In the popup below find your process and click Attach.

 Stop recording the macro using Tools -> Macros as below:

 Save the macro using Tools -> Macros as below:




 Upon saving, the macro will appear in the Macro Explorer. I have named it Attach To My Program.


 Lastly we can also place a shortcut to this macro on the Debug toolbar to make things even simpler.

 Go to Tools -> Customize -> Commands and under Toolbar dropdown select Debug as below:


 Hit the Add Command button and on the below popup select macros under Categories andAttachToMyProgram under commands:

 Now from under the Modify Selection rename the command as shown below:

Now the AttachToMyProgram shortcut show appear in the Debug toolbar as shown below:

6. Now close the console application and start again. We will again see the “I am started” message. Now simply hit the AttachToMyProcess shortcut on the Debug bar and press any key in the console application window. There you are! You are in the debug session and the second breakpoint is hit. Now you can easily attach to your process with a click of a button.

0 comments:

Sql Scheduled regularly Backup

SQL Server management studio scheduled backup automatically . You have to follow these three steps to back up your SQL Server database...

SQL Server management studio scheduled backup automatically .

You have to follow these three steps to back up your SQL Server databases by using Windows Task Scheduler:
Step A: Use SQL Server Management Studio Express or Sqlcmd to create the following stored procedure in your master database:


USE [master] 
GO 
/****** Object:  StoredProcedure [dbo].[sp_BackupDatabases] ******/ 
SET ANSI_NULLS ON 
GO 
SET QUOTED_IDENTIFIER ON 
GO 
 
CREATE PROCEDURE [dbo].[sp_BackupDatabases]  
            @databaseName sysname = null,
            @backupType CHAR(1),
            @backupLocation nvarchar(200) 
AS 
 
       SET NOCOUNT ON; 
           
            DECLARE @DBs TABLE
            (
                  ID int IDENTITY PRIMARY KEY,
                  DBNAME nvarchar(500)
            )
           
             -- Pick out only databases which are online in case ALL databases are chosen to be backed up
             -- If specific database is chosen to be backed up only pick that out from @DBs
            INSERT INTO @DBs (DBNAME)
            SELECT Name FROM master.sys.databases
            where state=0
            AND name=@DatabaseName
            OR @DatabaseName IS NULL
            ORDER BY Name
           
            -- Filter out databases which do not need to backed up
            IF @backupType='F'
                  BEGIN
                  DELETE @DBs where DBNAME IN ('tempdb','Northwind','pubs','AdventureWorks')
                  END
            ELSE IF @backupType='D'
                  BEGIN
                  DELETE @DBs where DBNAME IN ('tempdb','Northwind','pubs','master','AdventureWorks')
                  END
            ELSE IF @backupType='L'
                  BEGIN
                  DELETE @DBs where DBNAME IN ('tempdb','Northwind','pubs','master','AdventureWorks')
                  END
            ELSE
                  BEGIN
                  RETURN
                  END
           
            -- Declare variables
            DECLARE @BackupName varchar(100)
            DECLARE @BackupFile varchar(100)
            DECLARE @DBNAME varchar(300)
            DECLARE @sqlCommand NVARCHAR(1000) 
        DECLARE @dateTime NVARCHAR(20)
            DECLARE @Loop int                  
                       
            -- Loop through the databases one by one
            SELECT @Loop = min(ID) FROM @DBs
 
      WHILE @Loop IS NOT NULL
      BEGIN
 
-- Database Names have to be in [dbname] format since some have - or _ in their name
      SET @DBNAME = '['+(SELECT DBNAME FROM @DBs WHERE ID = @Loop)+']'
 
-- Set the current date and time n yyyyhhmmss format
      SET @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),101),'/','') + '_' + REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','')  
 
-- Create backup filename in path\filename.extension format for full,diff and log backups
      IF @backupType = 'F'
            SET @BackupFile = @backupLocation+REPLACE(REPLACE(@DBNAME, '[',''),']','')+ '_FULL_'+ @dateTime+ '.BAK'
      ELSE IF @backupType = 'D'
            SET @BackupFile = @backupLocation+REPLACE(REPLACE(@DBNAME, '[',''),']','')+ '_DIFF_'+ @dateTime+ '.BAK'
      ELSE IF @backupType = 'L'
            SET @BackupFile = @backupLocation+REPLACE(REPLACE(@DBNAME, '[',''),']','')+ '_LOG_'+ @dateTime+ '.TRN'
 
-- Provide the backup a name for storing in the media
      IF @backupType = 'F'
            SET @BackupName = REPLACE(REPLACE(@DBNAME,'[',''),']','') +' full backup for '+ @dateTime
      IF @backupType = 'D'
            SET @BackupName = REPLACE(REPLACE(@DBNAME,'[',''),']','') +' differential backup for '+ @dateTime
      IF @backupType = 'L'
            SET @BackupName = REPLACE(REPLACE(@DBNAME,'[',''),']','') +' log backup for '+ @dateTime
 
-- Generate the dynamic SQL command to be executed
 
       IF @backupType = 'F' 
                  BEGIN
               SET @sqlCommand = 'BACKUP DATABASE ' +@DBNAME+  ' TO DISK = '''+@BackupFile+ ''' WITH INIT, NAME= ''' +@BackupName+''', NOSKIP, NOFORMAT'
                  END
       IF @backupType = 'D'
                  BEGIN
               SET @sqlCommand = 'BACKUP DATABASE ' +@DBNAME+  ' TO DISK = '''+@BackupFile+ ''' WITH DIFFERENTIAL, INIT, NAME= ''' +@BackupName+''', NOSKIP, NOFORMAT'        
                  END
       IF @backupType = 'L' 
                  BEGIN
               SET @sqlCommand = 'BACKUP LOG ' +@DBNAME+  ' TO DISK = '''+@BackupFile+ ''' WITH INIT, NAME= ''' +@BackupName+''', NOSKIP, NOFORMAT'        
                  END
 
-- Execute the generated SQL command
       EXEC(@sqlCommand)
 
-- Goto the next database
SELECT @Loop = min(ID) FROM @DBs where ID>@Loop
 
END

Step B: In a text editor, create a batch file that is named Sqlbackup.bat, and then copy the text from one of the following examples into that file, depending on your scenario:
Example1: Full backups of all databases in the local named instance of SQLEXPRESS by using Windows Authentication

// Sqlbackup.bat
sqlcmd -S .\EXPRESS –E -Q "EXEC sp_BackupDatabases @backupLocation='D:\SQLBackups\', @backupType='F'" 

 Example2: Differential backups of all databases in the local named instance of SQLEXPRESS by using a SQLLogin and its password
// Sqlbackup.bat
sqlcmd -U SQLLogin -P password -S .\SQLEXPRESS -Q "EXEC sp_BackupDatabases  @backupLocation ='D:\SQLBackups', @BackupType=’D’"
 Note: The SQLLogin shouldhave at least the Backup Operator role in SQL Server.

Example 3: Log backups of all databases in local named instance of SQLEXPRESS by using Windows Authentication
// Sqlbackup.bat
sqlcmd -S .\SQLEXPRESS -E -Q "EXEC sp_BackupDatabases @backupLocation='D:\SQLBackups\',@backupType='L'"

Example 4: Full backups of the database USERDB in the local named instance of SQLEXPRESS by using Windows Authentication
// Sqlbackup.bat
sqlcmd -S .\SQLEXPRESS -E -Q "EXEC sp_BackupDatabases @backupLocation='D:\SQLBackups\', @databaseName=’USERDB’, @backupType='F'"
Similarly, you can make a differential backup of USERDB by pasting in 'D' for the @backupType parameter and a log backup of USERDB by pasting in 'L' for the @backupType parameter.
Step C: Schedule a job by using Windows Task Scheduler to execute the batch file that you created in step B. To do this, follow these steps:
  1. On the computer that is running SQL Server Express, click Start, point to All Programs, point to Accessories, point toSystem Tools, and then click Scheduled Tasks. 
  2. Double-click Add Scheduled Task. 
  3. In the Scheduled Task Wizard, click Next. 
  4. Click Browse, click the batch file that you created in step B, and then click Open. 
  5. Type SQLBACKUP for the name of the task, click Daily, and then click Next. 
  6. Specify information for a schedule to run the task. (We recommend that you run this task at least one time every day.) Then, click Next.
  7. In the Enter the user name field, type a user name, and then type a password in the Enter the password field. 

    Note This user should at least be assigned the BackupOperator role at SQL Server level if you are using one of the batch files in example 1, 3, or 4.
  8. Click Next, and then click Finish. 
  9. Execute the scheduled task at least one time to make sure that the backup is created successfully.
Note The folder for the SQLCMD executable is generally in the Path variables for the server after SQL Server is installed, but if the Path variable does not list this folder, you can find it under <Install location>\90\Tools\Binn (For example: C:\Program Files\Microsoft SQL Server\90\Tools\Binn).
 Be aware of the following when you use the procedure that is documented in this article:
  • The Windows Task Scheduler service must be running at the time that the job is scheduled to run. We recommend that you set the startup type for this service as Automatic. This makes sure that the service will be running even on a restart.
  • There should be lots of space on the drive to which the backups are being written. We recommend that you clean the old files in the backup folder regularly to make sure that you do not run out of disk space. The script does not contain the logic to clean up old files. 

0 comments: