Thursday, April 30, 2020

How to open FTP dashboard from Azure App Service

If you want to deploy your app to Azure App Service using FTP/S so it is an important part you know the credential of FTP.So in this article, I will show you from which palace you get FTP details.


Open FTP dashboard

  1. In the Azure portal, search for and select App Services.

2. Select the web app you want to deploy.

3. Select Deployment Center > FTP > Dashboard.



Get FTP connection information

In the FTP dashboard, select Copy to copy the FTPS endpoint and app credentials.

It's recommended that you use App Credentials to deploy to your app because it's unique to each app. However, if you click User Credentials, you can set user-level credentials that you can use for FTP/S login to all App Service apps in your subscription.

Thank you,
Arjun Walmiki







Wednesday, April 29, 2020

How to set command timeout in asp.net core in entity framework

If you're using the DI container to manage the DbContext (i.e. you're adding the DbContext to the service collection), the command timeout can be specified in the options.
In Startup.cs  file ConfigureServices method.
services.AddDbContext<YourDbContext>(options => options.UseSqlServer(
    this.Configuration.GetConnectionString("YourConnectionString"),
    sqlServerOptions => sqlServerOptions.CommandTimeout(60))
);
 Same code are as below
public void ConfigureServices(IServiceCollection services)
        {
          services.AddDbContext<KLASSAKTContext>(option => option.UseSqlServer(Configuration.GetConnectionString("DbKlassakt"),
                sqlServerOptions => sqlServerOptions.CommandTimeout(60)));
}
Hope it is help you,
Arjun Walmiki


Sunday, April 19, 2020

Create A Stored Procedure In SQL Server

In this article you will learn about how to create a stored procedure in SQL without parameter and with parameter .This article  is useful for beginner who want to learn how to create SP.


What is a Stored Procedure?

A SQL stored procedure (SP) is a collection SQL statements and sql command logic, which is compiled and stored on the database. Stored procedues in SQL allows us to create SQL queries to be stored and executed on the server. Stored procedures can also be cached and reused. The main purpose of stored procedures to hide direct SQL queries from the code and improve performance of database operations such as select, update, and delete data.
You can create and execute stored procedures using the Object Explorer in SQL Server or using SQL Server Management Studio (SSMS).

So let's start with how to create a stored procedure without parameter.


  1. CREATE PROCEDURE stpGetAllUserDetail  
  2. AS  
  3. BEGIN   
  4.     -- Select statements for procedure here  
  5.     Select * from tblUserDetail  
  6. END  

What are parameters in stored procedures?

Parameters in SPs are used to pass input values and return output values. There are two types of parameters:
  1. Input parameters - Pass values to a stored procedure.
  2. Output parameters - Return values from a stored procedure.

How to create a SELECT query SP with parameters?

In the previous steps, we created a simple SP that returned all rows from a table. Now, let's create a new SP that will take a city name as an inpurt parameter and will return all rows where city name matches the input parameter value.
Here is the updated SP with a parameter @CityName.



  1. GO  
  2. -- =============================================  
  3. -- Author:      Arjun Walmiki  
  4. -- Create date: 19-April-2020  
  5. -- Description: Return specific city records  
  6. -- =============================================  
  1. CREATE PROCEDURE stpGetAllUserDetailByCityName  
  2.  -- Add the parameters for the stored procedure here  
  3.     @CityName nvarchar(30)  
  4. AS  
  5. BEGIN   
  6.     
  7. -- SET NOCOUNT ON added to prevent extra result sets from  
  8.     -- interfering with SELECT statements.  
  9.     SET NOCOUNT ON;  
  10.   
  11.     Select * From tblUserDetail  
  12.     where City like '%'+@CityName+'%'  
  13.  
  14. END  
  15. GO

How to create a INSERT query based stored procedure?

 
We can use an INSERT INTO SQL query to insert data into a table. The following SQL statement creates an INSERT SP with three parameters.

  1. SET ANSI_NULLS ON  
  2. GO  
  3. SET QUOTED_IDENTIFIER ON  
  4. GO  
  5. -- =============================================  
  6. -- Author:      Arjun Walmiki 
  7. -- Create date: 19-April-2020  
  8. -- Description: To create a new member  
  9. -- =============================================  
  10. CREATE PROCEDURE stpInsertUserDetail 
  11. @Name varchar(50),  
  12. @City varchar(25),  
  13. @Phone varchar(15)  
  14.   
  15. AS  
  16. BEGIN  
  17.     -- SET NOCOUNT ON added to prevent extra result sets from  
  18.     -- interfering with SELECT statements.  
  19.     SET NOCOUNT ON;  
  20.   
  21.     Insert into tblUserDetail (Name,City,Phone)   
  22.            Values (@Name,@City, @Phone)  
  23.   
  24. END  
  25. GO  
Thank you Hope it help to you !!!!


Arjun Walmiki




Monday, April 6, 2020

How to get your Visual Studio 2017 product key.

Hi if you want product ket than you can easily get your Visual Studio product key. Just follow these simple steps.
1.) first of all open Open Registry. Click Start (windows icon) > regedit.

or type regedit inside Run window

HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > Microsoft > VisualStudio -> 14.0 > Registration > 2000.0×0000 > PIDKEY


This method worked for me, I hope this can help you guys :)


Thank you,
Arjun Walmiki








Friday, April 3, 2020

Web Application Project Option in Visual Studio 2005 Tutorial 2

Hi All,

This is continue Web Application Project Option in Visual Studio 2005 Tutorial 1 


Tutorial 2: Code-Behind with VS 2005 Web Application Projects

The below tutorial helps explain the code-behind model and project structure of pages built within VS 2005 Web Application Projects. Please make sure that you have already completed Tutorial 1: Building Your First Web Application Project before reviewing this one.

Some Background on the VS 2003 Code-behind Model for ASP.NET Applications


ASP.NET Pages in a VS 2003 web project have two files associated with them -- one is a .aspx file that contains the html and declarative server control markup, and the other is a .cs "code-behind" file that contains the UI logic for the page:


Control markup declarations are defined within the .aspx file itself.  For example:
<asp:Label  id="Label1" runat="server"></asp:Label>
And corresponding protected field declarations are added in the .cs code-behind class that match the name and type of controls defined within the .aspx file. For example:
protected System.Web.UI.WebControls.Label Label1:
ASP.NET does the work of wiring up a reference from this code-behind field declaration to point to the declared control in the .aspx file at runtime. Developers can then program directly against this control within their code-behind file. 

VS 2003 automatically adds/updates these protected control field declarations at the top of the code-behind file (these are updated everytime a developer switches into WYSIWYG design-view):
namespace Webapplication1
{
public class webform1:System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1:
protected System.Web.UI.WebControls.Label Label1:
}
private void page_Load (object sender ,System.EventArgs e)
{
}
VS 2003 also then maintains a hidden region block inside the code-behind of tool-generated code to register event-handlers and keep them in sync with the design-surface:
#region Web Form Designer generate code
overrride protected void OnInit (EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Button.Click +=new system.EventHandler(this.Button1_Click);
this.Load += new system.EventHandler(this.Load);
}
#endrigion
There are two common complaints/problems with this:
1) VS 2003 is adding/deleting code in the same file where the developer is authoring their own code -- and accidental conflicts/mistakes do end up happening (for example: some code that the developer writes can sometimes get modified or deleted by VS).  The tool-generated hidden block above is also a little "messy" for some people's tastes. 
2) The control-declarations are only updated when a develo#eper using VS 2003 activates the WYSIWYG page designer.  If a developer is only using the source-editor to customize the page, they will not get control updates, and will instead have to add these control declarations manually (which is a pain).

VS 2005 Code-behind Model for ASP.NET Applications

VS 2005 uses a code-behind model conceptually the same as VS 2003. Specifically, each .aspx page continues to inherit from a code-behind class that contains protected control field references for each control in the .aspx page:
What is different between VS 2003 and VS 2005 is that Visual Studio no longer injects its tool-specific wire-up code in the developer's code-behind file.  Instead, it takes advantage of a new language feature in C# and VB called "partial types" (or partial classes) to split the code-behind implementation across two files.  One of these partial class files is the developer-owned code-behind file that contains developer-written event-handlers and code for the page.  The other partial class file is then a tool-generated/maintained file that contains the protected control field declarations and the other design-time code that Visual Studio requires.  The benefit of splitting them out into two separate files at design-time is that it ensures that the code that VS creates and maintains never interferes (or deletes) code that a developer writes.  At compile-time, these files are compiled together and generate a single code-behind class. 
With the VS 2005 Web Application project model, the design-time partial class is generated and persisted on disk by VS 2005.  This new design-time partial-class file has the filename naming pattern: PageName.aspx.designer.cs.  If you expand any new page created within your VS 2005 Web Application project, you can see this file listed under the associated Page.aspx file along with the developer-owned code-behind file:
If you open up the code-behind file of the page (Default.aspx.cs), you'll then see the code-behind logic of the page -- which contains all of the code and event handlers that a developer writes (and no tool-generated "code-spit" content -- which means it stays very clean):
If you open the Default.aspx.designer.cs file, you'll then see the design-time code of the page -- which contains the field declarations for controls within the .aspx page:
Because the MyWebProject._Default class is marked as "partial" in both of the above two files, the compiler will merge them into a single generated class at compile-time. This means that any variable, method or field generated in the default.aspx.designer.cs file can be used from the default.aspx.cs code-behind file (just as if it was declared in the code-behind file itself). For example, within the Page_Load event handler we could easily add the below code that uses the "Label1" and "Calendar1" control:
This will compile clean and run just fine -- because the "Label1" and "Calendar1" field references have been defined within the default.aspx.designer.cs file.
When you do a build inside a VS 2005 Web Application project, all pages, user-controls, master pages (and their associated code-behind files+design-time generated files), along with all other standalone classes within the project are compiled into a single assembly. This is the same behavior as with VS 2003.
Click here to go to the next tutorial.