dotnet and db

Follow us on Facebook

SQL Server Mountain View Mountain View Mountain View

Sunday, April 28, 2019

Cloud technology

April 28, 2019 0



What is  Cloud computing?

Cloud technologies are the services which provide a strong compute, optimized services to establish a strong database and  IT solutions.

Benefits of Cloud

Cloud makes an entrepreneur life easy on creating IT solutions as cloud saves a lot of efforts on spending time on server maintenance and investment on software purchase.
Just by using a simple configured computer a developer can connect a Cloud instance and work with high-end technologies.
Server maintenance also cloud service provider takes care. So, that saves a lot for a firm in terms of money and manpower as well.
The best feature of Cloud is pay-as-you-go pricing. It means to pay for use only.

How does Cloud work?

Cloud works on the internet base. By connecting to the instance a user can access different features just by paying for the utilized features only.


Who are the Cloud service providers in the market?

We have different cloud providers available nowadays in the market like
Amazon, Google, Microsoft Azure, IBM, and so many other providers are also available.


Disadvantages of Cloud

Cloud is an internet-based service so the services accessing depends on internet speed.
Even high secured environment is available, our code is always there in providers hand. So, there is a chance to stop our applications in crucial situations.

The best example is Wikileaks. Wikileaks was hosted its code base on Amazon web services.
They stopped their services to Wikileaks at one stage to restrict the company journals opposite to different countries even they are right.
Read More

Convert Column values into Column names

April 28, 2019 0
















In this post let us see how to convert column values into the column names using MySQL.

DROP TABLE IF EXISTS Temp1;
CREATE TEMPORARY TABLE Temp1 (
    Col1 VARCHAR(100)
);

INSERT INTO Temp1(Col1) VALUES('Xyz A'),('BCD A'),('C'),('B');
 
SET @SqlString = (SELECT
    GROUP_CONCAT(DISTINCT Col1
        ORDER BY Col1 ASC
        SEPARATOR '` VARCHAR(100), `')FROM  Temp1);
SET @SqlString = CONCAT("`",@SqlString,"` VARCHAR(100)");

DROP TABLE IF EXISTS TempRowsToColumns;
SET @sql1 = CONCAT("CREATE TEMPORARY TABLE TempRowsToColumns (ID INT AUTO_INCREMENT PRIMARY KEY,",@SqlString,")");
 
PREPARE stmt FROM @sql1;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
SELECT * FROM TempRowsToColumns;
Read More

Thursday, September 13, 2018

Properties

September 13, 2018 2



In C#. properties are the extension of data fields. In the object-oriented programming language, encapsulation and hiding are the pillars.  By using various access modifiers like private, public, protected, internal etc, we can control the accessibility of the class members.
Usually, inside a class, we declare a data field as private and provide a set of public SET and GET methods to access the data fields. Since this is not a good programming practice to give direct accessibility of data fields outside the class.

Let us suppose we have an employee class with three fields, Empid, name and company name.
If we give direct access to these three fields outside the class, there is a chance to get false data as below.


In any organization, the employee never has an ID with the negative number as well null value to the Employee name. So, while supplying the required data it is mandatory to identify whether the data is valid or not.
So, by applying data encapsulation and hiding techniques, we should stop direct access to the data fields and provide through properties as below



Using GET() and SET() methods we can read value and assign to the field members.

GET() represents read property and SET() represents write property.
A property with GET() only,  it is a read-only property. We can't manipulate the value on it. In the above example, Company name is common for all employees across the organization. So, we should stop overwriting on it.  So, it has GET() attribute only.
Read More

Friday, August 31, 2018

C#.Net introduction

August 31, 2018 0




C# is a modern, strong, object-oriented programming language inaugurated by Microsoft. C# (the product) was developed by Anders Hejlsberg and his team. C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows the use of various high-level languages on different computer platforms and architectures.

The following reasons make C# a widely used professional language:


  • C# is a modern, strong programming language
  • C# strongly supports the OOP concepts
  • It is easy to learn.
  • It is a part of DotNet Framework.
  • Using C# we can develop modern applications on windows, console, mobile, and web.
  • C# contains the same working environment as C/C++. So, the legacy C\C++ developers could feel more comfortable to work with C#.Net.
  • Automatic memory management techniques available in C#.Net.
  • C#.Net works (not only C# all the languages that are supported by the .Netframework) perfectly works on Windows platforms and other than windows, the user needs to take the help of other tools(on Linux - mono)




Read More

Thursday, August 30, 2018

Linkbutton control

August 30, 2018 0


Link button displays the button like a hyperlink. Use the text property to change the link text.
Link button works on the server side. We can have all the basic properties like font, style properties etc...
The difference between the Link button and Hyperlink is, Hyperlink works on the client side and the link button works on the server side. When we click on the Link button, the page will get the past back.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LinkbuttonControl.aspx.cs" Inherits="DotNetPractice.Controls.LinkbuttonControl" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:LinkButton ID="LinkButton1" OnClick="LinkButton1_Click" OnClientClick="alert('You clicked on link button')" runat="server">LinkButton</asp:LinkButton>
        </div>
    </form>
</body>

</html>

Code behind:

using System;

namespace DotNetPractice.Controls
{
    public partial class LinkbuttonControl : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"~\Controls\ButtonControl.aspx");
        }
    }
}


Read More

Wednesday, August 29, 2018

Button control

August 29, 2018 0


Button control is to post the request to the server. It is an ASP.Net server control which contains the tag 'runat="server"'.

The syntax of a button controls is
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" / >


ID is the unique identification source of the control, 'runat="server"' indicates its a server control, Text is the value which displays on the user interface and onclick is the event which fires when the user clicks on the button control.


PropertyDescription
AccessKeyIt is used to set the keyboard shortcut for the control. Pressing the Access key with "Alt" we can execute the event. 
TabIndexSet the tab order of the control.
BackColorbackground color of the control can be set using this property.
BorderColorTo set the border color of the control.
BorderWidthTo set the width of the border of the control.
FontTo set the font for the control text.
ForeColorIt is used to set the color of the control text.
TextIt is used to set the text to be shown for the control.
ToolTipIt displays the text when the mouse is over the control.
VisibleTo set the visibility of control on the form.
HeightTo set the height of the control.
WidthTo set the width of the control.
  Using the above features/properties we can decorate the controls.

Aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ButtonControl.aspx.cs" Inherits="DotNetPractice.Controls.ButtonControl" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" AccessKey="A" TabIndex="0" BackColor="Red" ForeColor="White" BorderColor="Green" BorderWidth="5" runat="server" ToolTip="Its a button" Text="Button" Height="100" Width="200" OnClick="Button1_Click"/>
            <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>

        </div>
    </form>
</body>
</html>


Code behind

using System;

namespace DotNetPractice.Controls
{
    public partial class ButtonControl : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            lblMessage.Text= "Clicked on the button";
        }
    }
}


Output: 

When the user clicks on the button/by pressing Alt+A(supplied access key), we can get the output "Clicked on the button"


OnClientClick event OnClientClick event works on the client side and before submitting the page to the server we can pass information and confirmation (alert & confirm) messages to the user and we can do other javascript related activities. Confirmation message shows the message with "OK & Cancel" options and by clicking OK only the page will get submit, otherwise postback will not happen.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ButtonControl.aspx.cs" Inherits="DotNetPractice.Controls.ButtonControl" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" AccessKey="A" TabIndex="0" BackColor="Red" ForeColor="White" BorderColor="Green" BorderWidth="5" runat="server" ToolTip="Its a button" Text="Button" Height="100" Width="200" OnClick="Button1_Click" OnClientClick="alert('You clicked on the Button1')"/>

             <asp:Button ID="Button2" TabIndex="1" BackColor="green" ForeColor="White" BorderColor="red" BorderWidth="5" runat="server" ToolTip="Its a button" Text="Button" Height="100" Width="200" OnClick="Button2_Click" OnClientClick="return confirm('Have you clicked on Button2?')"/>

        </div>
    </form>
</body>
</html>




Read More

Tuesday, August 28, 2018

ASP.Net Server Controls

August 28, 2018 0



ASP.NET Web server controls are the objects on ASP.NET Web pages. They are to perform different operations like storing, display and transfer the data. Each server control contains its own set of events(click, change, load etc...) to execute the functionalities. They are called control events. ASP.Net controls contains the tag "runat="server"". There are different types of Server controls available in ASP.Net

They are
1. Button Controls
2. Text Box
3. Label
4. Checkbox
5. Radio button

6. List Controls
  • Drop-down list
  • List box
  • Radio button list
  • Checkbox list
  • Bulleted list
7. Hyperlink Control
8. Image Control



Read More
x

Get Updates On

Discussion updates

Straight Into Your INBOX!

Enter your email address to subscribe to this website and receive notifications of new posts by email.