Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Sunday, November 10, 2024

Refer linked in profile for the latest post

 Subhash Sharma (Technical Program Manager) Technical Project and Product Management

Saturday, February 24, 2024

 Why we have to use lean six sigma black belt? If we already have PMP and Prince 2 so why requried lean six sigma.

- Lean Six Sigma Black Belt plays a crucial role in leading and executing process improvement projects within an organization. Few key reasons why organizations required to use Lean Six Sigma Black Belts:

1. Leadership: Black Belts are trained to lead cross-functional teams in process improvement projects, driving change and achieving results.
2. Advanced Problem Solving: They are experts in using Lean Six Sigma tools and methodologies to identify, analyze, and solve complex process problems.
3. Project Management: Black Belts are skilled in project management, ensuring that improvement projects are completed on time and within budget.
4. Data Analysis: They have a deep understanding of statistical analysis tools and techniques, allowing them to make data-driven decisions.
5. Change Management: Black Belts are trained in change management principles, helping them to effectively manage resistance to change and ensure successful implementation of improvements.
6. Cost Reduction: By identifying and eliminating waste and defects in processes, Black Belts help organizations reduce costs and improve efficiency.
7. Customer Focus: They are trained to prioritize customer needs and requirements, ensuring that process improvements result in increased customer satisfaction.
8. Continuous Improvement: Black Belts promote a culture of continuous improvement within an organization, helping to drive ongoing success and growth.
9. Quality Improvement: They focus on improving quality, ensuring that products and services meet or exceed customer expectations.
10. Cross-Functional Collaboration: They work across different departments and functions, bringing together diverse perspectives to solve problems and drive improvement.
Overall, Lean Six Sigma Black Belts are valuable assets to organizations seeking to improve their processes, reduce costs, and increase customer satisfaction.

-If we already have PMP and Prince 2 so why requried lean six sigma.

While PMP and PRINCE2 focus on project management principles and methodologies, Lean Six Sigma Black Belt focus on process improvement, data-driven decision making, and quality control, which can enhance your effectiveness in managing projects and delivering successful outcomes.

- Few differences to help more understanding

Wednesday, November 23, 2022

What is the Difference Between Agile and Waterfall?

Agile and waterfall are two different methodologies of processes to complete projects or work items/Tasks/Epics. Agile is an iterative methodology that incorporates a cyclic and collaborative process. Waterfall is a sequential methodology that can also be collaborative, but tasks are generally handled in a more linear process.


Waterfall Methodology

waterfall is a traditional, plan-driven practice for developing systems. One of the earliest software development lifecycle (SDLC) approaches, it is a practice of developing in stages: Gather and analyze software requirements, design, develop, test, and deploy into operations. The output of one stage is required to initiate the next stage.

Waterfall is best used on software development projects that are well-defined, predictable, and unlikely to significantly change. This usually applies to simpler, small-scale projects. Its sequential nature makes it largely unresponsive to adjustments, so budgets and delivery timelines will be affected when business requirements change during the development cycle.


Waterfall projects have a high degree of process definition, little or no variability in output and they do not accommodate feedback during the development cycle.

Pros of the Waterfall model

It is among the most simple types to operate. Because of the project’s nature, each phase contains deliverables and also a review process.

It is best suitable for smaller tasks with defined requirements that are simple to understand and execute.

completion of the job in a shorter amount of time

Both the procedure and the outcomes are meticulously recorded.

Simple to adopt a method for restructuring teams

This project management approach is useful for dealing with dependencies.

Cons of the Waterfall Model

This is not the preferred product for a big project.

This approach is less effective if the requirement is not clearly defined at the start.

It is difficult to travel ahead and make changes to previous stages.

The testing step starts after the design phase is finished. As a result, there is a high probability that flaws will be found required during the development process when they will be more costly to repair.

Agile Methodology

Agile software development practices have been in use since the early 1990s, born out of the need to adapt and rapidly deliver products. The Agile methodology allows for the exploration of new ideas and quicker determinations about which of those ideas are viable.


Additionally, Agile methods are designed to adapt to changing business needs during development. There are two primary frameworks used in Agile: Scrum and Kanban. Key components of Scrum are iterations and velocity, while a key point with Kanban is its work-in-progress status.

Agile methods are based on iterative, incremental development that rapidly delivers a viable business product. Incremental development breaks the product into smaller pieces, building some of it, assessing, and adapting. Agile projects do not start with complete upfront definitions; variability through development is expected. And, importantly, continuous feedback is built into the development process. Their inherent adaptability allows them to flexibly realign product development, and it's often cheaper to adapt to user feedback based on building something fast than it is to invest in trying to get everything right up front.


While Agile brings flexibility and speed to development, the practices that really accelerate the delivery of scalable, reliable code are in the DevOps realm.


Pros of the Agile Model

It is a method that is centered on the customer. As a consequence, the customer is always involved throughout the entire process.

Agile teams are extremely active and self, and as a consequence, they are much more inclined to deliver superior results in development projects.

The agile software development approach ensures that development quality is maintained throughout the development process.

The strategy is solely based on the notion of incremental consistent growth in progress. As a consequence, both the customer and the crew are informed of what has and has not been accomplished. As a consequence, the risk of the development phase is minimized.

Cons of the Agile Model

It is not a viable strategy for small-scale development efforts.

In order to try and make crucial choices during the meeting, it is vital to have a professional presentation.

The cost of implementing an agile approach is just somewhat greater when compared to traditional development approaches.

If the project manager isn’t clear on the end goal, the project might easily become derailed.


Saturday, October 15, 2022

Enable CORS in DotNet core in Startup.cs file

Browser security prevents a web page from making requests to a different domain than the one that served the web page. This restriction is called the same-origin policy. The same-origin policy prevents a malicious site from reading sensitive data from another site. Sometimes, you might want to allow other sites to make cross-origin requests to your app. Example Below  


public void ConfigureAuthentication(IServiceCollection services)

        {

            JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();

            services.AddCors(options =>

            {

                options.AddPolicy("CorsPolicy",

                    builder => builder

                    .SetIsOriginAllowed((host) => true)

                    .AllowAnyMethod()

                    .AllowAnyHeader()

                    .WithExposedHeaders("Content-Disposition")

                    .AllowCredentials());

            });

                   }

Tuesday, February 4, 2014

Ref and Out

ref object a, out object out specifies that the parameter is an output parameters, i.e. it has no value until it is explicitly set by the method. ref specifies that the value is a reference that has a value, and whose value you can change inside the method.

Tuesday, October 1, 2013

DataTable Rows filter

DataView dv = dsDetail.Tables["Employee"].DefaultView; dv.RowFilter = "Id in(10,2,1,5,6,1)"; DataTable dt = dv.ToTable(); ((Repeater)ctrl).DataSource = dt; ((Repeater)ctrl).DataBind();

Saturday, April 23, 2011

What Happens When a Request Reaches IIS

This is the link for All the details related parsing asp.net page and generating Requst and Response


http://msdn.microsoft.com/en-us/library/ms972974.aspx

Wednesday, April 20, 2011

Disable Browser Back Button using Javascript

head runat="server">
script type="text/javascript" language="javascript">
javascript:window.history.forward(0);
/script>
/head>

Disable Browser Back Button using Javascript

head runat="server">
script type="text/javascript" language="javascript">
javascript:window.history.forward(0);
/script>
/head>

Tuesday, March 22, 2011

Microsoft Enterprises Library

Microsoft Enterprises Library provide API where we dont need to open and close connection and they have sme predefind method .You dont need to create your own method .it has pedefined method for all that things for insert update delete retrieve and some more specific operation...........

You have to download the Entterprise lIbrary first and Add some Dll through AddReferences from a bin folder of Enterprises Library add

using Microsoft.Practices.EnterpriseLibrary.Data.dll
using Microsoft.Practices.EnterpriseLibrary.Common..dll

and Add the classes in code behind

using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Practices.EnterpriseLibrary.Data.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Data;


//Retrieve and Insert value Using Entrprises library

protected void Page_Load(object sender, EventArgs e)
{
Database db = DatabaseFactory.CreateDatabase();
string sqlcommand = "select * from emp";
System.Data.Common.DbCommand dbCommand = db.GetSqlStringCommand(sqlcommand);
using (IDataReader reader = db.ExecuteReader(
dbCommand))
{
Gridview1.DataSource = reader;
Gridview1.DataBind();
}
}
public void save(string name)
{
DatabaseFactory.CreateDatabase().ExecuteNonQuery("inserts12",name);
}
protected void Button1_Click(object sender, EventArgs e)
{
save("subhash");
}

/////////web.config file
inside the ConfigSection
section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,Microsoft.Practices.EnterpriseLibrary.Data" />

after closing configsection You have to add

/configSections>
dataConfiguration defaultDatabase="Master1"/>

//dataconfiguration same name as the connection string because DatabaseFactory.CreateDatabase(); using for connection

//connection string

add name="Master1" providerName="System.Data.SqlClient" connectionString="Data Source=subhash-9f7eec2;user id=;password=;database=Master;integrated security=sspi;"/>

Friday, March 18, 2011

Generic

using System.Collections.Generic;

In an Arraylist, As Each item is stored as an object, During Sorting and traversing the list, it must be typed at runtime, and then compared for sorting/searching wheareas Generic list has all items typed compile time, which saves a lot of workload during sorting and searching.

The List class is the generic equivalent of the ArrayList class. It implements the IList generic interface using an array whose size is dynamically increased as required.

Type safety : it gives error at compile time if a data type mismatch is found.

Code reusablity : Same code is reused for various data tyoe like int,string etc.

public class User
{
protected string name;
protected int age;
protected double salary;
public string Name { get { return name; } set { name = value; } }
public int Age { get { return age; } set { age = value; } }
public double Salary { get { return salary; } set { salary = value; } }

static void Main(string[] args)
{
List users = new List();

for (int x = 0; x < 5; x++)
{
User user = new User();
user.Name ="Name : "+ "subhash" + x;
user.Age = x+20;
user.salary =x + 12500;
users.Add(user);
}

foreach (User user in users)
{
System.Console.WriteLine(System.String.Format("{0}:{1}:{2}", user.Name, user.Age,user.salary));
}

Console.ReadLine();
}
}

Tuesday, March 15, 2011

Using Statement in C#

Using block defines a scope, outside of which an object or objects will be disposed.
The using statement takes an object parameter, this object is destroyed when the statement finish's, or rather disposed of (IDisposable). The object provided to the using statement must implement the IDisposable interface. This interface provides the Dispose method, which should release the object's resources.
A "using" statement can be exited either when the end of the "using" statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement.
In the below example font1 object is disposed of after the using statement has been executed.
using (Font font1 = new Font("Arial", 10.0f)){}
Multiple objects can be used in with a "using" statement, but they must be declared inside the "using" statement, like this:
using (Font font3 = new Font("Arial", 10.0f),
font4 = new Font("Arial", 10.0f)){
// Use font3 and font4.
}



The problem is that SqlConnection and SqlCommand implement IDisposable, which means they could have unmanaged resources to cleanup and it is our job, the developers, to make sure Dispose() gets called on these classes after we are finished with them. And, because an exception could be raised if the database is unavailable ( a very real possibility on WebHost4Life :) ), we need to make sure Dispose() gets called even in the case of an exception.

Personally, I like the “using” keyword in C#. Internally, this bad boy generates a try / finally around the object being allocated and calls Dispose() for you. It saves you the hassle of manually creating the try / finally block and calling Dispose().

The new code would looking something like this:

using (SqlConnection cn = new SqlConnection(connectionString))
{
using (SqlCommand cm = new SqlCommand(commandString, cn))
{
cn.Open();
cm.ExecuteNonQuery();
}
}

This is essentially equivalent to the following, although my guess is that C# will internally generate two try / finally blocks (one for the SqlConnection and one for the SqlCommand), but you get the idea:

SqlConnection cn = null;
SqlCommand cm = null;

try
{
cn = new SqlConnection(connectionString);
cm = new SqlCommand(commandString, cn);
cn.Open();
cm.ExecuteNonQuery();
}
finally
{
if (null != cm);
cm.Dispose();
if (null != cn)
cn.Dispose();
}

Friday, March 4, 2011

Cache object use for dataBase Access(Application Level Caching/Programmatic and Data Caching)

//First Page where we store dataset values into caching and use that value another page...

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);

SqlCommand cmd = new SqlCommand("select Id,Name from emp", con);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
Cache.Insert("user", ds);

/////second page access caching value..........

if (Cache["user"] != "")
{
ds = (DataSet)Cache["user"];
GridView1.DataSource = ds;
GridView1.DataBind();

}

Caching in ASP.NET

This is the link where we can understand easily for Caching.......



http://www.c-sharpcorner.com/uploadfile/vishnuprasad2005/implementingcachinginasp.net11302005072210am/implementingcachinginasp.net.aspx

Thursday, March 3, 2011

Ajax tutorial Link

http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_suggest

Tuesday, March 1, 2011

LINQ Bind Gridview and Insert Data

SqlConnection con=new SqlConnection (ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataClassesDataContext db = new DataClassesDataContext(con);
//linq Table emps
var query = from emp1 in db.emps select new { emp1.id, emp1.Name };
GridView1.DataSource = query;
GridView1.DataBind();
}
}

protected void Button1_Click(object sender, EventArgs e)
{
DataClassesDataContext db = new DataClassesDataContext(con);
db.Connection.Open();
//emp Name of the Table
emp empob = new emp();
empob.Name = TextBox1.Text.Trim();
db.emps.InsertOnSubmit(empob);
db.SubmitChanges();
db.Connection.Close();
TextBox1.Text = "";

}

Monday, February 28, 2011

Read Data from Excel and Export to Sql server

SqlBulkCopy Use for Insert Bulk Data into sql server.You have to create one table inside the sql server and create only structure of the table which we have in Excel .and Use the code Below.

//File upload pick the file name and Details is a sheet name Inside the .Xls file

DataTable dt = new DataTable();

protected void Button2_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+FileUpload1.PostedFile.FileName +";Extended Properties=Excel 8.0; ");
OleDbDataAdapter da = new OleDbDataAdapter("select * from [Details$] ", con);
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
InsertBulkDATA();

}
private void InsertBulkDATA()
{
SqlBulkCopy sbc = new SqlBulkCopy(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);
sbc.DestinationTableName = "tblData";
sbc.WriteToServer(dt);
}

Saturday, February 26, 2011

Hosting WCF Services in IIS

This is the link which will describe how to Host wcf services in IIS

http://www.youtube.com/watch?v=mX8quq7MoeI&feature=related

WCF Implementation(for retrieve Data and match the data for login)

File---> New WEBSITE---->WCF SERVICES
we have Iservice.cs Interface and second is Service.cs Class

Inside the Iservice.cs (Interface) we have to define one interface for that.(that will be accessible with other application)

[OperationContract]
DataTable GetUserId();

second is....Service.cs Class give the method body which we create interface...

}
public DataTable GetUserId()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);
string cmd = "select Name from customer";
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd, con);
DataSet ds = new DataSet();
da.Fill(ds);

return ds.Tables[0];
}
after that Build the website....

///////Use service with other application.....

create new website

Add services with your application :- Right click on solution explorer there is Add Service Reference select your services otherwise paste the url of service and ok .

////Inside the button click u can acces use that....

protected void Button1_Click(object sender, EventArgs e)
{
ServiceReference1.ServiceClient objService = new ServiceReference1.ServiceClient();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);
con.Open();
DataTable ds = new DataTable();
ds = objService.GetUserId();
if (ds.Rows.Count > 0)
{
foreach (DataRow item in ds.Rows)
{
string id = item["name"].ToString();
if (id == textUserId.Text)
{
lblMessage.Text = "Valid";
break;
}
else
lblMessage.Text = "InValid";
}

}
}


///////want to use same application.........

Right click on solution explorer on same website and click on AddNewItem pick NewForm ...
Inside new form ..............

Add services with your application :- Right click on solution explorer there is Add Service Reference select your services otherwise paste the url of service and ok .


protected void Button1_Click(object sender, EventArgs e)
{
Service sf = new Service();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);
con.Open();
DataTable ds = new DataTable();
ds = sf.GetUserId();
if (ds.Rows.Count > 0)
{
foreach (DataRow item in ds.Rows)
{
string id = item["name"].ToString();
if (id == textUserId.Text)
{
lblMessage.Text = "Valid";
break;
}
else
lblMessage.Text = "InValid";
}

}
}

Thursday, February 24, 2011

WCF Introduction

//This is the link for Understand the End Point.
http://www.youtube.com/watch?v=GC344FZeWqc&feature=related

Windows Communication Foundation (Code named Indigo) is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined features of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.

WCF services provide better reliability and security in compared to ASMX web services.

In WCF, there is no need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.

WCF has integrated logging mechanism, changing the configuration file settings will provide this functionality. In other technology developer has to write the code.

EndPoint:---WCF Service is a program that exposes a collection of Endpoints. Each Endpoint is a portal for communicating with the world.

All the WCF communications are take place through end point. End point consists of three components. 1)Address 2)Binding 3)CONTRACT

1) Address:- Basically URL, specifies where this WCF service is hosted .Client will use this url to connect to the service. e.g

2) Binding:- Binding will describes how client will communicate with service. There are different protocols available for the WCF to communicate to the Client.

Simple definition for Binding describes how the client will communicate with service. We can understand with an example.

Consider a scenario say, I am creating a service that has to be used by two type of client. One of the client will access SOAP using http and other client will access Binary using TCP. How it can be done? With Web service it is very difficult to achieve, but in WCF its just we need to add extra endpoint in the configuration file.
EX:- endpoint address="http://localhost:8090/MyService/MathService.svc"
contract="IMathService"
binding="wsHttpBinding"/>
endpoint address="net.tcp://localhost:8080/MyService/MathService.svc"
contract="IMathService"
binding="netTcpBinding"/>


3)cONTRACT:- Collection of operation that specifies what the endpoint will communicate with outside world.In WCF, all services are exposed as contracts. Contract is a platform-neutral and standard way of describing what the service does. Mainly there are four types of contracts available in WCF.......

Service Contract :-Service contracts describe the operation that service can provide. For Eg, a Service provide to know the temperature of the city based on the zip code, this service is called as Service contract. It will be created using Service and Operational Contract attribute.


Data Contract :- Data contract describes the custom data type which is exposed to the client. This defines the data types, that are passed to and from service. Data types like int, string are identified by the client because it is already mention in XML schema definition language document, but custom created class or data types cannot be identified by the client e.g. Employee data type. By using DataContract we can make client to be aware of Employee data type that are returning or passing parameter to the method.


Message Contract :-Default SOAP message format is provided by the WCF runtime for communication between Client and service. If it is not meeting your requirements then we can create our own message format. This can be achieved by using Message Contract attribute.



Fault Contract :- Suppose the service I consumed is not working in the client application. I want to know the real cause of the problem. How I can know the error? For this we are having Fault Contract. Fault Contract provides documented view for error occurred in the service to client