tag:blogger.com,1999:blog-62591916537505794562024-03-20T13:26:13.732+05:30Ajay Gangwar | .Net Dev CornerAjay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.comBlogger62125truetag:blogger.com,1999:blog-6259191653750579456.post-4539290179487200912023-06-12T08:54:00.006+05:302023-06-12T09:04:19.685+05:30VS Messages - IDE0090 - 'new' expression can be simplified<style>
/*Red heading 2*/
.head2 {
color: #ff3131;
font-family: verdana;
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
.head3 {
display: block;
font-size: 1.17em;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
/* Red border */
hr.new1 {
border-top: 1px solid red;
}
/* Dashed red border */
hr.new2 {
border-top: 1px dashed red;
}
/* Dotted red border */
hr.new3 {
border-top: 1px dotted red;
}
/* Thick red border */
hr.new4 {
border: 1px solid red;
}
/* Small rounded green border */
hr.news {
border: 3px dotted #00bf63;
border-radius: 5px;
}
/* Medium rounded green border */
hr.newm {
border: 6px solid green;
border-radius: 5px;
}
/* Large rounded green border */
hr.newl {
border: 10px solid green;
border-radius: 5px;
}
table.postAjax {
font-family: verdana;
font-size: large;
border-collapse: collapse;
width: 100%;
}
.postAjax td, th {
border: 1px solid #dddddd;
padding: 8px;
}
.postAjax tr:nth-child(even) {
background-color: #0080006b;
}
</style>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRy2DV7xE-U1YOc3uwp4V5cKPhyys_duBg5JqAXXY10N7_8SLclTkzJbAtD_V4J1URHwlv4QaF724P1EyEwyQo2N_mxPo7NC6wlEAq7UDuZ8L25XTR2mkEg1q26hlLRPn5WQanmoM_hWM7E4gT4g0bwbRMtUpXweRt-Ow2iXIF21CpNwJMnctYyW_-/s940/VS%20Messages%20-%20IDE0090.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="788" data-original-width="940" height="335" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRy2DV7xE-U1YOc3uwp4V5cKPhyys_duBg5JqAXXY10N7_8SLclTkzJbAtD_V4J1URHwlv4QaF724P1EyEwyQo2N_mxPo7NC6wlEAq7UDuZ8L25XTR2mkEg1q26hlLRPn5WQanmoM_hWM7E4gT4g0bwbRMtUpXweRt-Ow2iXIF21CpNwJMnctYyW_-/w400-h335/VS%20Messages%20-%20IDE0090.png" width="400" /></a></div><br /><span><a name='more'></a></span><div><br /></div><div><br /></div>
<div><br /></div>
<hr class="news" />
<p style="font-family: verdana; text-align: center;">
<span class="head2">VS Messages - IDE0090 - 'new' expression can be simplified</span>
</p>
<hr class="news" />
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div>
<table class="postAjax" style="text-align: left;">
<tbody><tr>
<th>Rule ID</th>
<td>IDE0090</td>
</tr>
<tr>
<th>Title</th>
<td>Simplify new expression</td>
</tr>
<tr>
<th>Applicable languages</th>
<td>C# 9.0+</td>
</tr>
</tbody></table>
</div>
<p style="line-height: 3em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;">This style rule concerns the use of C# 9.0 target-typed new expressions when the created type is apparent.<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<p style="line-height: 3em;">
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>Example:</b></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">Visual Studio Intellisense shows "new" expression can be a simplified message.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">I have this code:</span>
</p>
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0px;"><br /></pre><pre style="line-height: 125%; margin: 0px;">MyClass myClass= <span style="color: #008800; font-weight: bold;">new</span> MyClass();</pre><pre style="line-height: 125%; margin: 0px;"><br /></pre>
</div>
<br />
<p>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">VS Intellisense shows:<br /><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;"><b>'new'</b> expression can be simplified<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<p style="line-height: 3em;">
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>Solution:</b></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">Change the code to:</span>
</p>
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0px;"><br /></pre><pre style="line-height: 125%; margin: 0px;">MyClass instance = <span style="color: #008800; font-weight: bold;">new</span>();</pre><pre style="line-height: 125%; margin: 0px;"><br /></pre>
</div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-79944287257097789612023-05-10T08:20:00.001+05:302023-05-10T08:22:18.540+05:30What is the difference between ExecuteScalar, ExecuteReader, and ExecuteNonQuery?<style>
/*Red heading 2*/
.head2 {
color: #fa0830;
font-family: verdana;
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
.head3 {
display: block;
font-size: 1.17em;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
/* Red border */
hr.new1 {
border-top: 1px solid red;
}
/* Dashed red border */
hr.new2 {
border-top: 1px dashed red;
}
/* Dotted red border */
hr.new3 {
border-top: 1px dotted red;
}
/* Thick red border */
hr.new4 {
border: 1px solid red;
}
/* Small rounded green border */
hr.news {
border: 3px solid green;
border-radius: 5px;
}
/* Medium rounded green border */
hr.newm {
border: 6px solid green;
border-radius: 5px;
}
/* Large rounded green border */
hr.newl {
border: 10px solid green;
border-radius: 5px;
}
</style>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdqX9hdypHqfky80xWldKlV9y8fwsrUPH0RqNTrjCtad1A8C6YZ52C6LbKxIdNcNI5tNG86mHCTedlcO1uyRqQNKN9OSkIguSSXcahmFZnxusMCTTlTv75WcnLR6nqcFr8pWGXEBGlsVRCOgxGmocaVs96RMhQqfqCDNPsQXZ3qYHb8wREEi3naUF/s940/FB%20-%204.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="788" data-original-width="940" height="335" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdqX9hdypHqfky80xWldKlV9y8fwsrUPH0RqNTrjCtad1A8C6YZ52C6LbKxIdNcNI5tNG86mHCTedlcO1uyRqQNKN9OSkIguSSXcahmFZnxusMCTTlTv75WcnLR6nqcFr8pWGXEBGlsVRCOgxGmocaVs96RMhQqfqCDNPsQXZ3qYHb8wREEi3naUF/w400-h335/FB%20-%204.png" width="400" /></a></div><br /><span><a name='more'></a></span><div><br /></div>
<div><br /></div>
<div><br /></div>
<hr class="news" />
<p style="font-family: verdana; text-align: center;"><span class="head2">Difference Between | ExecuteScalar, ExecuteReader, and ExecuteNonQuery?</span></p>
<hr class="news" />
<div><br /></div>
<div><br /></div>
<div><br /></div>
<p>
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>ExecuteScalar():</b></span>
</p>
<p style="line-height: 3em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(1) <b style="color: #660000;">ExecuteScalar()</b> works Non-Action Queries that contain aggregate functions.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(2) Return the first row and first column value of the query result.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(3) The return type is an <b>object</b><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(4)The return value is compulsory and should be assigned to a variable of the required type.<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<p>
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>ExecuteReader():</b></span>
</p>
<p style="line-height: 3em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(1) <b style="color: #660000;">ExecuteReader()</b> works with Action and Non-Action Queries (Select).<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(2) Returns the collection of rows selected by the Query.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(3) The return type is <b>DataReader</b><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(4)The return value is compulsory and should be assigned to another object DataReader.<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<p>
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>ExecuteNonQuery():</b></span>
</p>
<p style="line-height: 3em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(1) <b style="color: #660000;">ExecuteNonQuery()</b> works with Action Queries only (Create, Alter, Drop, Insert, Update, Delete).<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(2) Returns the count of rows affected by the Query.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(3) The return type is <b>Int32</b><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(4) For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(5) For all other types of statements, the return value is -1.<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-43759900657689758422023-05-09T10:02:00.004+05:302023-05-09T10:32:14.665+05:30C# | ExecuteNonQuery<style>
/*Red heading 2*/
.head2 {
color: #fa0830;
font-family: verdana;
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
.head3 {
display: block;
font-size: 1.17em;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
/* Red border */
hr.new1 {
border-top: 1px solid red;
}
/* Dashed red border */
hr.new2 {
border-top: 1px dashed red;
}
/* Dotted red border */
hr.new3 {
border-top: 1px dotted red;
}
/* Thick red border */
hr.new4 {
border: 1px solid red;
}
/* Small rounded green border */
hr.news {
border: 3px solid green;
border-radius: 5px;
}
/* Medium rounded green border */
hr.newm {
border: 6px solid green;
border-radius: 5px;
}
/* Large rounded green border */
hr.newl {
border: 10px solid green;
border-radius: 5px;
}
</style>
<div class="separator" style="clear: both; text-align: center;"><a href="https://www.ajaygangwar.com/2023/05/c-executenonquery.html" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="788" data-original-width="940" height="335" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlNWmbDpEtUws33vBdLv2-SIq3vNT_Elf-vapFYrWNzwq1diaSmW1FTWPtzBtP8rzNyI8-7k4eXNRdmJa0D9yx7LR9hDHoW5wkao81iVREMASGmc4FuH7gcLUoy8eFOOLcJ3CLDBM0pFvxqKO4euIAstGgc1b7wMp72kiusku0AQ4S0lJCJ4ksN8Nr/w400-h335/FB%20-%203.png" width="400" /></a></div>
<div><br /></div>
<span><a name='more'></a></span><div><br /></div>
<div><br /></div>
<hr class="news" />
<p style="font-family: verdana; text-align: center;"><span class="head2">C# | What is the use of ExecuteNonQuery() in C#?</span></p>
<hr class="news" />
<div><br /></div>
<div><br /></div>
<div><br /></div>
<p>
<span style="background: rgb(255, 213, 79); border-radius: 5px; font-family: verdana; font-size: large; padding: 5px;"><b>ExecuteNonQuery():</b></span>
</p>
<p style="line-height: 2.8em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;"><b style="color: black;">Method:</b> SqlCommand.ExecuteNonQuery<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;"><b style="color: black;">Namespace:</b> System.Data.SqlClient<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;"><b style="color: black;">Assembly:</b> System.Data.SqlClient.dll<br /><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;"><b>Executes</b> a Transact-<b>SQL statement</b> against the connection and <b>returns the number of rows affected</b>.<br /><br /></span>
</p>
<div><br /></div>
<p><span style="color: #2b00fe; font-family: verdana;"><b style="color: black;">Example:</b><br /></span></p>
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; font-size: medium; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="font-size: large; line-height: 125%;"><span style="color: #008800; font-weight: bold;">private</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">CreateCommand</span>(<span style="color: #333399; font-weight: bold;">string</span> queryString, <span style="color: #333399; font-weight: bold;">string</span> connectionString)
{
<span style="color: #008800; font-weight: bold;">using</span> (SqlConnection connection = <span style="color: #008800; font-weight: bold;">new</span> SqlConnection(connectionString))
{
SqlCommand command = <span style="color: #008800; font-weight: bold;">new</span> SqlCommand(queryString, connection);
command.Connection.Open();
command.ExecuteNonQuery();
}
}
</pre>
<div><br /></div>
<div style="line-height: 1.8em;">
<span style="color: #2b00fe; font-family: verdana; font-size: medium;"><b style="color: black;">queryString:</b> a string that is a Transact-SQL statement (such as UPDATE, INSERT, or DELETE)<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: medium;"><b style="color: black;">connectionString:</b> a string to use to connect to the data source<br /></span>
</div>
</div>
<div><br /></div>
<div><br /></div>
<p style="line-height: 3em;">
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(1) <b style="color: #660000;">ExecuteNonQuery()</b> works with catalog operations (querying the structure of a database or creating database objects such as tables).<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(2) <b style="color: #660000;">ExecuteNonQuery()</b> works to change the data in a database without using a DataSet by executing UPDATE, INSERT, or DELETE statements.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(3) <b style="color: #660000;">ExecuteNonQuery()</b> returns no rows.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(4) Any output or return parameter values mapped to parameters are populated with data.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(5) The return type is <b>Int32</b><br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(6) For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(7) For all other types of statements, the return value is -1.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(8) When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(9) When SET NOCOUNT ON is set on the connection (before or as part of executing the command, or as part of a trigger initiated by the execution of the command) the rows affected by individual statements stop contributing to the count of rows affected that is returned by this method.<br /></span>
<span style="color: #2b00fe; font-family: verdana; font-size: large;">(10) If no statements are detected that contribute to the count, the return value is -1. If a rollback occurs, the return value is also -1.<br /></span>
</p>
<div><br /></div>
<div><br /></div>
<div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-3759346329461390672023-02-15T22:53:00.004+05:302023-02-15T22:53:35.765+05:30Can we inherit multiple classes?<p><span style="font-family: helvetica;">No, multiple inheritances are not supported in .Net. <span></span></span></p><a name='more'></a><span style="font-family: helvetica;"><br /></span><p></p><p><span style="font-family: helvetica;"><span>But we can achieve this using implementation of multiple interface.</span></span></p><h3 style="text-align: left;"><span style="font-family: helvetica;">Example:</span></h3><p><span style="font-family: helvetica;">There are two Parent classes Paretn1 and Parent2. This is inherited by the Child class, In the <i>GetData()</i> method, the child calls the parent class method <i>PrintData()</i>. </span></p><p><span style="font-family: helvetica;">In this case which method will be executed? It is very difficult for CLR to identify which method to call. It shows that multiple inheritances create ambiguity in the oops concept. In order to avoid this ambiguity we are going for multiple interface implementations.</span></p><p><span style="font-family: helvetica;"><br /></span></p><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #000088;">public</span> <span style="color: #000088;">class</span> <span style="color: #7f0055;">Parent1</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">public</span> <span style="color: #000088;">string</span> <span style="color: #7f0055;">PrintData</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">return</span> <span style="color: #008800;">"This is parent1"</span><span style="color: #666600;">;</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">public</span> <span style="color: #000088;">class</span> <span style="color: #7f0055;">Parent2</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">public</span> <span style="color: #000088;">string</span> <span style="color: #7f0055;">PrintData</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">return</span> <span style="color: #008800;">"This is parent2"</span><span style="color: #666600;">;</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">public</span> <span style="color: #000088;">class</span> <span style="color: #7f0055;">Child1</span> <span style="color: #666600;">:</span> <span style="color: #7f0055;">Parent1</span><span style="color: #666600;">,</span> <span style="color: #7f0055;">Parent2</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">public</span> <span style="color: #000088;">string</span> <span style="color: #7f0055;">GetData</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #000088;">return</span> <span style="color: #000088;">this</span><span style="color: #666600;">.</span><span style="color: #7f0055;">PrintData</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div><span face="Trebuchet MS, sans-serif"><span style="color: #666600; font-family: helvetica;"><br /></span></span></div><p><br /></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-67917242640067380322023-02-14T22:52:00.004+05:302023-02-17T03:23:35.117+05:30How to add the prefix to the ID column with auto increment ID in SQL?<p><span style="font-family: helvetica;">Here, I am taking an example of a Product. We have different types of products, so I want to generate a new ProductId using a prefix of value like the below:<span></span></span></p><a name='more'></a><p></p><p><span style="font-family: helvetica;"><br /></span></p><p><span style="font-family: helvetica;">Taking the example of "Vanilla Ice-cream", Now I want to generate an id with the prefix "Ice-Vanila-" with autoincrement number having the length of 7.</span></p><p><span style="font-family: helvetica;"><br /></span></p><div style="text-align: left;"><span style="font-family: helvetica;">In the first step, I am going to add two Products using the below queries:</span></div><div style="text-align: left;"><span style="font-family: helvetica;">---------------------------------------------------------------------------</span></div><div style="text-align: left;"><span style="font-family: helvetica;">Create Table #Test<br />(<br /> Id Int Identity(1,1),<br /> PId As 'Ice-Vanila-' + Replace(Str(Id, 7), Space(1), '0')<br />)</span></div><div style="text-align: left;"><span style="font-family: helvetica;"><br /></span></div><div style="text-align: left;"><span style="font-family: helvetica;">Insert Into #Test Default Values</span></div><div style="text-align: left;"><span style="font-family: helvetica;">Insert Into #Test Default Values</span></div><p><span style="font-family: helvetica;">Select * From #Test</span></p><div style="text-align: left;"><span style="font-family: helvetica;">--Drop table #Test</span></div><div style="text-align: left;"><span style="font-family: helvetica;"><br /></span></div><div style="text-align: left;"><span style="font-family: helvetica;">---------------------------------------------------------------------------</span></div><div><span style="font-family: helvetica;">Result:</span></div><div><span style="font-family: helvetica;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiE6efW-G1dYkhYbo1IW2ivU_CkmFWvEguejueCo6nT6kSSFB4xfgYB_MY4-S_0y2gMS37PNuUOlzgm60F8dZLN11Vt5TMEj2A1nKZracq-j5af-w2h81WlpNPT2d0JP93uRBGD3krkjW_6IZqWQ72Kg1nPz9Rjpxtit0vgXmqtSKOCFDqVg9aVXA2p" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: helvetica;"><img data-original-height="102" data-original-width="193" src="https://blogger.googleusercontent.com/img/a/AVvXsEiE6efW-G1dYkhYbo1IW2ivU_CkmFWvEguejueCo6nT6kSSFB4xfgYB_MY4-S_0y2gMS37PNuUOlzgm60F8dZLN11Vt5TMEj2A1nKZracq-j5af-w2h81WlpNPT2d0JP93uRBGD3krkjW_6IZqWQ72Kg1nPz9Rjpxtit0vgXmqtSKOCFDqVg9aVXA2p=s16000" /></span></a></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">---------------------------------------------------------------------------</span></div><span style="font-family: helvetica;">Now I am adding new records to check, will this work?</span></div><div><span style="font-family: helvetica;">---------------------------------------------------------------------------</span></div><div><div><span style="font-family: helvetica;">Insert Into #Test Default Values</span></div><div><span style="font-family: helvetica;">Insert Into #Test Default Values</span></div><div><span style="font-family: helvetica;">Insert Into #Test Default Values</span></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">Select * From #Test</span></div></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">---------------------------------------------------------------------------</span></div><div><span style="font-family: helvetica;">Result: Yeah!, It's working </span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEghNLUX3HE39zdXKSUCBOzky86Wq610zX-1Vzn2imngdudhq-O91NcMhCeGWYNZOAaJL2Q1CdxCTe7K7G032sGBa8GpILezbOUsfxqKODCnhvuQ87Ph_pYvcONSVsPRAUvYsfGXeKnZsPDs8ccpzrr3dH9yhqfyF059zjHL_DX_GFdPDc8DU6mWKa1Y" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: helvetica;"><img data-original-height="151" data-original-width="209" src="https://blogger.googleusercontent.com/img/a/AVvXsEghNLUX3HE39zdXKSUCBOzky86Wq610zX-1Vzn2imngdudhq-O91NcMhCeGWYNZOAaJL2Q1CdxCTe7K7G032sGBa8GpILezbOUsfxqKODCnhvuQ87Ph_pYvcONSVsPRAUvYsfGXeKnZsPDs8ccpzrr3dH9yhqfyF059zjHL_DX_GFdPDc8DU6mWKa1Y=s16000" /></span></a></div><span style="font-family: helvetica;"><br /><br /></span></div><div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-17084237971599740172023-02-13T23:37:00.001+05:302023-02-14T23:41:43.876+05:30What is mean by Shadowing?<h2 style="text-align: left;"><span style="background-color: white;"><span style="font-family: helvetica;">Shadowing:</span></span></h2><div class="MsoNormal" style="background: white; margin: 9.6pt 0in 12pt; text-align: justify;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;">The terms "Shadowing", is defined in VB.Net. In C#, this is known as new keyword.<span><a name='more'></a></span></span></div><div class="MsoNormal" style="background: white; margin: 9.6pt 0in 12pt; text-align: justify;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;">When the method is defined in the base class, is not able to override and we need to provide a different implementation for the same in the derived class. In this kind of scenario, we can use hide the base class implementation and provide a new implementation using the Shadows(VB.Net)/new(C#) keyword.<o:p></o:p></span></div><div class="MsoNormal" style="background: white; margin: 9.6pt 0in 12pt; text-align: justify;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><br /></span></div><h2 style="background: white; margin: 9.6pt 0in 12pt; text-align: justify;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;">Example:</span></h2><div style="background: rgb(238, 238, 238); border: 1pt solid rgb(214, 214, 214); mso-border-alt: solid #D6D6D6 .5pt; mso-element: para-border-div; padding: 3pt;"><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">Public</span> <span style="color: #7f0055;">Class</span> <span style="color: #7f0055;">ParentClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Public</span> <span style="color: #7f0055;">Sub</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span><span style="color: #008800;">"Parent class"</span><span style="color: #666600;">)</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">End</span> <span style="color: #7f0055;">Sub</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">End</span> <span style="color: #7f0055;">Class</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">Public</span> <span style="color: #7f0055;">Class</span> <span style="color: #7f0055;">ChildClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Inherits</span> <span style="color: #7f0055;">ParentClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Public</span> <span style="color: #7f0055;">Shadows</span> <span style="color: #7f0055;">Sub</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span><span style="color: #008800;">"Child class"</span><span style="color: #666600;">)</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">End</span> <span style="color: #7f0055;">Sub</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">End</span> <span style="color: #7f0055;">Class</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Dim</span> p <span style="color: #7f0055;">As</span> <span style="color: #7f0055;">New</span> <span style="color: #7f0055;">ParentClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Dim</span> c <span style="color: #7f0055;">As</span> <span style="color: #7f0055;">New</span> <span style="color: #7f0055;">ChildClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> <span style="color: #7f0055;">Dim</span> pc <span style="color: #7f0055;">As</span> <span style="color: #7f0055;">ParentClass</span> <span style="color: #666600;">=</span> <span style="color: #7f0055;">New</span> <span style="color: #7f0055;">ChildClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> p<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> c<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"> pc<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><b><span style="color: #7f0055;">Output</span></b><b><span style="color: #666600;">:</span></b><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">Parent</span> <span style="color: #000088;">class</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">Child</span> <span style="color: #000088;">class</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif" style="font-family: helvetica;"><span style="color: #7f0055;">Parent</span> <span style="color: #000088;">class</span></span></div></div><p><span style="font-family: helvetica;"><br /></span></p><p><br /></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-5015887823191441092023-02-12T23:17:00.005+05:302023-02-14T23:28:15.542+05:30How do you hide base class methods?<p><span style="font-family: helvetica;">Using the <b>new</b> keyword in the derived class, the base class method can be hidden or suppressed. New implementation can be added to the derived class.<span></span></span></p><a name='more'></a><p></p><p><span style="font-family: helvetica;"><br /></span></p><div style="text-align: left;"><span style="font-family: helvetica;"><b>Or In other words, </b><br />In method hiding, we can redefine the base class method in the derived class by using the <b>new</b> keyword.</span></div><div style="text-align: left;"><span style="font-family: helvetica;"><br /></span></div><div style="text-align: left;"><span style="font-family: helvetica;"><br /></span></div><div style="text-align: left;"><span style="font-family: helvetica;"><br /></span></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-34116784147792581352023-02-11T00:34:00.000+05:302023-02-14T00:35:16.346+05:30What does the keyword "virtual" mean in the method definition?<p><span style="font-family: helvetica; font-size: medium;">Ans: <span style="color: #3d85c6;">The method can be over-ridden.</span></span></p><p><span style="font-family: helvetica; font-size: medium;"></span></p><a name='more'></a><span style="font-family: helvetica; font-size: medium;"><br /></span><p></p><p><span style="font-family: helvetica; font-size: medium;">The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class.</span></p><p><span style="font-family: helvetica; font-size: medium;"><br /></span></p><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; color: #666666; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="font-family: helvetica; font-size: medium;"> <span style="color: #000088;">public</span> <span style="color: #000088;">virtual</span> <span style="color: #000088;">void</span> <span style="color: #7f0055;">Add</span><span style="color: #666600;">()</span><o:p></o:p></span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; color: #666666; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="font-family: helvetica; font-size: medium;"> <span style="color: #666600;">{</span><o:p></o:p></span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="font-family: helvetica; font-size: medium;"><span style="color: #666666;"> </span><span style="color: #7f0055;">return </span>a + b<span style="color: #7f0055;">;</span></span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="font-family: helvetica; font-size: medium;"> <span style="color: #666600;">}</span></span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica; font-size: medium;"><br style="background-color: #eeeeee; color: #666666;" /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica; font-size: medium;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span style="font-family: helvetica; font-size: medium;">Point to be noted:</span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><ul style="text-align: left;"><li></li><li><span style="font-family: helvetica; font-size: medium;">By default, methods are non-virtual. You cannot override a non-virtual method.</span></li><li><span style="font-family: helvetica; font-size: medium;">You cannot use the <b>virtual</b> modifier with the <b>static</b>, <b>abstract</b>, <b>private</b>, or <b>override</b> modifiers.</span></li><li><span style="font-family: helvetica; font-size: medium;">When a virtual method is invoked, the run-time type of the object is checked for an overriding member. The overriding member in the most derived class is called, which might be the original member, if no derived class has overridden the member.</span></li></ul></div>
<pre><code><p><span style="font-family: helvetica;"></span></p></code></pre>
<p><span style="font-family: helvetica;"></span></p>
Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-78670961682269980802023-02-10T10:00:00.001+05:302023-02-10T10:00:00.138+05:30How method overriding different from overloading?<h2 style="background: white; margin-bottom: 0.0001pt; text-align: left;"><span style="font-family: verdana;"><u>Overriding different from Overloading:</u></span></h2><div class="MsoNormal" style="background: white; margin: 9.6pt 0in 12pt; text-align: justify;"><span style="color: #3d85c6; font-family: verdana; font-size: medium;">If we are overriding the method, derived class method behaviour is changed from the base class. In Overloading, method with same name by different signature is used.<span><a name='more'></a></span><o:p></o:p></span></div><h2 style="background: white; margin-bottom: 0.0001pt; text-align: justify;"><span face="Trebuchet MS, sans-serif"><b><span style="font-family: verdana; font-size: medium;">Example:</span></b></span></h2><div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt; text-align: justify;"><span face="Trebuchet MS, sans-serif"><b><br /></b></span></div><br /><div style="background: rgb(238, 238, 238); border: 1pt solid rgb(214, 214, 214); mso-border-alt: solid #D6D6D6 .5pt; mso-element: para-border-div; padding: 3pt;"><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <br /><o:p></o:p></span><span style="color: #000088;"> public</span> <span style="color: #000088;">class</span> <span style="color: #7f0055;">ParentClass</span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #666600;"> {</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #000088;">public</span> <span style="color: #000088;">virtual</span> <span style="color: #000088;">void</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span><span style="color: #008800;">"ParentClass"</span><span style="color: #666600;">);</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><br /></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #000088;">public</span> <span style="color: #000088;">class</span> <span style="color: #7f0055;">ChildClass</span> <span style="color: #666600;">:</span> <span style="color: #7f0055;">ParentClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #880000;">//Example for method override</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #000088;">public</span> <span style="color: #000088;">override</span> <span style="color: #000088;">void</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">()</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span><span style="color: #008800;">"ChildClass"</span><span style="color: #666600;">);</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><br /></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #880000;">//Example for method overload</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #000088;">public</span> <span style="color: #000088;">void</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">(</span><span style="color: #000088;">string</span> name<span style="color: #666600;">)</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span>name<span style="color: #666600;">);</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #880000;">//Example for method overload</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #000088;">public</span> <span style="color: #000088;">void</span> <span style="color: #7f0055;">Display</span><span style="color: #666600;">(</span><span style="color: #000088;">string</span> name<span style="color: #666600;">,</span> <span style="color: #000088;">string</span> country<span style="color: #666600;">)</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">{</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #7f0055;">Console</span><span style="color: #666600;">.</span><span style="color: #7f0055;">WriteLine</span><span style="color: #666600;">(</span><span style="color: #008800;">"Name:"</span><span style="color: #666600;">+</span>name <span style="color: #666600;">+</span><span style="color: #008800;">"Country: "</span><span style="color: #666600;">+</span> country <span style="color: #666600;">);</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <span style="color: #666600;">}</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><br /></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><br /></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ParentClass</span> p <span style="color: #666600;">=</span> <span style="color: #000088;">new</span> <span style="color: #7f0055;">ParentClass</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ChildClass</span> c <span style="color: #666600;">=</span> <span style="color: #000088;">new</span> <span style="color: #7f0055;">ChildClass</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ParentClass</span> pc <span style="color: #666600;">=</span> <span style="color: #000088;">new</span> <span style="color: #7f0055;">ChildClass</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif">p<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif">c<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif">pc<span style="color: #666600;">.</span><span style="color: #7f0055;">Display</span><span style="color: #666600;">();</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"> <o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><b><span style="color: #7f0055;">OutPut</span></b><b><span style="color: #666600;">:</span></b><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ParentClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ChildClass</span><o:p></o:p></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;">ChildClass</span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 0.0001pt; padding: 0in;"><span face="Trebuchet MS, sans-serif"><span style="color: #7f0055;"><br /></span></span></div></div><p></p><p><br /></p><p><br /></p><p><br /></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-56366564113496990302023-02-09T11:58:00.009+05:302023-02-09T12:24:35.106+05:30SQL Delete Records within a specific range<div dir="ltr" trbidi="on"><h2><span face=""trebuchet ms" , sans-serif" style="font-size: x-large;">SQL Delete Query with <b>BETWEEN</b> condition:</span></h2><div><span face=""trebuchet ms" , sans-serif" style="font-size: medium;">Here i want to delete record from table with in specific range.</span></div><div><span style="font-size: medium;"><span><a name='more'></a></span><span face=""trebuchet ms" , sans-serif"><br /></span></span></div><div><span style="font-size: large;"><span face=""trebuchet ms" , sans-serif">A <b>BETWEEN</b> condition with <b>WHERE</b> clause can be used to only remove rows with in specific range.</span><br /><span face=""trebuchet ms" , sans-serif"><br /></span><span face="Trebuchet MS, sans-serif"><span style="background-color: white; color: #242729; line-height: 19.5px;">You can use the </span><code style="background-color: #eff0f1; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #242729; margin: 0px; padding: 1px 5px; white-space: pre-wrap;">between</code><span style="background-color: white; color: #242729; line-height: 19.5px;"> function as below:</span></span></span></div><div><span face=""trebuchet ms" , sans-serif" style="font-size: large;"><br /></span></div><div><pre class="lang-sql prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><span style="font-size: medium;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">
DELETE</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">FROM</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span></code><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">dbo</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">WHERE</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">IdField</span><span class="pun" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">BETWEEN</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;">1</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">AND</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;">25
</span></span></pre></div></div><p><span style="font-size: large;"><span face="Trebuchet MS, sans-serif"><br /></span><span face="Trebuchet MS, sans-serif"><br /></span><span face="Trebuchet MS, sans-serif">You can also use below command same as above:</span><br /><br /></span></p><pre class="lang-sql prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><span><span style="font-size: medium;"><code style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">
DELETE</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">FROM</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span></code><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">dbo</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">
</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">WHERE</span><span class="kwd" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; margin: 0px; padding: 0px; white-space: inherit;"> </span><span style="color: #393318;">[</span></span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">IdField</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">> </span><span class="lit" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;">10</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">AND</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">IdField</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">< </span></span><span style="color: #7d2727; white-space: inherit;"><span style="font-size: medium;">25
</span><span style="font-size: large;">
</span></span></span></pre><div><span class="lit" style="border: 0px; color: #7d2727; font-size: large; margin: 0px; padding: 0px; white-space: inherit;"><br /></span></div><div><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;"><div style="color: black; font-size: x-large;"><span face="Trebuchet MS, sans-serif">You can also use below command same as above:</span></div><div style="color: black; font-size: x-large;"><br /></div><pre class="lang-sql prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; color: black; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><span style="font-size: medium;"><code style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">
DELETE</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px;">FROM</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px;"> </span></code><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">dbo</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">
</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"><span class="kwd" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">WHERE</span><span class="kwd" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; margin: 0px; padding: 0px; white-space: inherit;"> </span><span style="color: #393318;">[</span></span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">IdField</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;"> =</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">> </span><span class="lit" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">10</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="kwd" style="border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;">AND</span><span class="pln" style="border: 0px; color: #303336; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">TableName</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">].[</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">IdField</span><span class="pun" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;">]</span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #393318; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pln" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; color: #101094; margin: 0px; padding: 0px; white-space: inherit;"><= </span></span><span style="color: #7d2727; white-space: inherit;"><span style="font-size: medium;">25
</span><span style="font-size: large;">
</span></span></pre><div style="color: black; font-size: x-large;"><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;"><br /></span></div><div style="color: black; font-size: x-large;"><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;">Please Like & Share...</span></div><div style="color: black; font-size: x-large;"><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;"><br /></span></div><div style="color: black; font-size: x-large;"><span class="lit" style="border: 0px; color: #7d2727; margin: 0px; padding: 0px; white-space: inherit;"><br /></span></div></span></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-88588890190975298992022-09-13T02:14:00.001+05:302022-09-15T02:17:26.236+05:30HackerRank: SQL Basic Select "apanese Cities' Attributes"<div><span style="font-family: inherit; font-size: large;"><b>Question:</b></span></div><div><span style="font-family: inherit; font-size: large;">Query all attributes of every Japanese city in the <b>CITY</b> table. The <b>COUNTRYCODE</b> for Japan is JPN.<span><a name='more'></a></span></span></div><div><span style="font-family: inherit; font-size: large;"><br /></span></div><div><span style="font-family: inherit; font-size: large;">The <b>CITY</b> table is described as follows:</span></div><div><span style="font-family: inherit; font-size: large;"><br /></span></div><div><span style="font-family: inherit; font-size: large;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhPbmsfONC3mAkbOo9aTmoWzVONfWmKELpDXytJvKefn0Jww0D6MlgUMLI2EZqbev7LRLCW4-E1xoBtwbU7O0simv0U0zLMD18OlTG0HCjEFTo0Twz7XZd6JAnJG0H30nJZfTFy9HdwkMjR1I2kZbZYoplJV10PcwX-kuW6y5DrV1c1dZI9-GeHJBrO" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="469" data-original-width="570" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhPbmsfONC3mAkbOo9aTmoWzVONfWmKELpDXytJvKefn0Jww0D6MlgUMLI2EZqbev7LRLCW4-E1xoBtwbU7O0simv0U0zLMD18OlTG0HCjEFTo0Twz7XZd6JAnJG0H30nJZfTFy9HdwkMjR1I2kZbZYoplJV10PcwX-kuW6y5DrV1c1dZI9-GeHJBrO" width="292" /></a></div><br /><br /></span></div><div><span style="font-family: inherit; font-size: large;"><br /><b><span style="color: #2b00fe;">Answer:</span></b></span></div><div><span style="color: #2b00fe; font-size: large;"><b>SELECT </b>ID, NAME, COUNTRYCODE, DISTRICT, POPULATION<b> FROM CITY </b>WHERE COUNTRYCODE='JPN'<b>;</b></span></div><div><span style="font-family: inherit; font-size: large;"><b><br /></b></span></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-9805310373020674192022-09-12T01:49:00.002+05:302022-09-15T01:58:49.546+05:30HackerRank: SQL Basic Select BY ID<p><span style="font-family: arial; font-size: large;"><b>Question:</b></span></p><p><span style="font-family: arial; font-size: large;">Query all columns for a city in <b>CITY</b> with the <i>ID</i> 1661.<span></span></span></p><a name='more'></a><p></p><p><span style="font-family: arial; font-size: large;">The <b>CITY</b> table is described as follows:</span></p><p><span style="font-family: arial; font-size: large;"><br /></span></p><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh1akaU4umSvrF_Wu6VtVwsLboZpe2dfL11kfxoLk9ObmgGIMV5IvECbL8dcrarYMuiMM_3wyzMm9nUgrpe3Jvhd5nsnlX_svpFnt9KS_ruskmo1epDhFHonP9s1YGi2fTPX_Ncp1QBA0UX5NOZB07V4DR33VuL87kx-hr5fHr1S6JoZDceb3210pDX" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="469" data-original-width="570" src="https://blogger.googleusercontent.com/img/a/AVvXsEh1akaU4umSvrF_Wu6VtVwsLboZpe2dfL11kfxoLk9ObmgGIMV5IvECbL8dcrarYMuiMM_3wyzMm9nUgrpe3Jvhd5nsnlX_svpFnt9KS_ruskmo1epDhFHonP9s1YGi2fTPX_Ncp1QBA0UX5NOZB07V4DR33VuL87kx-hr5fHr1S6JoZDceb3210pDX=s16000" /></a></div><br /><br /></div><div><span style="color: #2b00fe; font-size: large;"><b>Answer:</b></span></div><div><span style="color: #2b00fe; font-size: large;"><b>SELECT </b>ID, NAME, COUNTRYCODE, DISTRICT, POPULATION<b> FROM CITY WHERE </b>ID=1661<b>;</b></span></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-46774927783664070852022-09-11T10:00:00.001+05:302022-09-11T10:00:00.129+05:30HackerRank: SQL Basic Select All<p><span style="font-size: x-large;"><b>Question:</b></span></p><p><span style="font-size: large;">Query all columns (attributes) for every row in the <b>CITY</b> table.</span></p><span><a name='more'></a></span><span style="font-size: large;"><br /></span><p></p><p><span style="font-size: large;">The CITY table is described as follows:</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><br /></div><span style="font-size: large;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjytL1RhOgqCewZh2_CT2b8eTPuNSWQllzLl0lvtjRsHG9SecKy4eKuF1Hwz6ocGca-jwln6M471q42gEIf-KwzhOytvQ8kQV7v-P6Le8G5X3ULsJGlo1Kx37huaZNlox64xNDQyxTdGrgJtOAGNXFoJWpPBJK6tDP0K52HxZnl3mLn1OXXwBc2KXQ3" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="469" data-original-width="570" height="329" src="https://blogger.googleusercontent.com/img/a/AVvXsEjytL1RhOgqCewZh2_CT2b8eTPuNSWQllzLl0lvtjRsHG9SecKy4eKuF1Hwz6ocGca-jwln6M471q42gEIf-KwzhOytvQ8kQV7v-P6Le8G5X3ULsJGlo1Kx37huaZNlox64xNDQyxTdGrgJtOAGNXFoJWpPBJK6tDP0K52HxZnl3mLn1OXXwBc2KXQ3=w400-h329" width="400" /></a></div><br /><br /></div><br /></span><span style="color: #2b00fe; font-size: x-large;"><b>Ans:</b></span><p></p><p><span style="color: #2b00fe; font-size: large;">SELECT ID, NAME, COUNTRYCODE, DISTRICT, POPULATION FROM CITY;</span></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-70198375901835356962022-09-10T02:06:00.001+05:302022-09-10T02:06:20.715+05:30HackerRank: SQL Basic Select 2<p><b><span style="font-size: x-large;">Question:</span></b></p><p><span style="font-size: large;">Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA.<span></span></span></p><a name='more'></a><p></p><p><span style="font-size: large;">The CITY table is described as follows:</span></p><p><span style="font-size: large;"> </span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEinkLebQ8Nvl6c_6uMrMPc2UPnSxJilZuntnv_wWfZ2rgSpbGPKicllLAVYi00l5RODCPU5LAXJqZQijq7Z4oz3tqO622D18vhzCML9LNx86woBiUlSmNwMoKxDajT4hJSaKLUg8PISOKJvptZBCCwjQVpTdYJ0LuDk9YYx28BGxBs4_ZxLAXfysd3m" style="margin-left: 1em; margin-right: 1em;"><span style="font-size: large;"><img alt="" data-original-height="469" data-original-width="570" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEinkLebQ8Nvl6c_6uMrMPc2UPnSxJilZuntnv_wWfZ2rgSpbGPKicllLAVYi00l5RODCPU5LAXJqZQijq7Z4oz3tqO622D18vhzCML9LNx86woBiUlSmNwMoKxDajT4hJSaKLUg8PISOKJvptZBCCwjQVpTdYJ0LuDk9YYx28BGxBs4_ZxLAXfysd3m" width="292" /></span></a></div><span style="font-size: large;"><br /></span><p></p><p><span style="color: #2b00fe; font-size: x-large;"><b>Answer:</b></span></p><p><span style="color: #2b00fe; font-size: large;">SELECT NAME FROM CITY WHERE POPULATION > 120000 AND COUNTRYCODE='USA';</span></p><div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-32439503700132005082022-09-09T03:02:00.001+05:302022-09-09T03:02:21.382+05:30HackerRank: SQL Basic Select 1<p><span style="font-family: inherit; font-size: x-large;"><b>QUESTION:</b></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;"><span style="font-family: inherit; font-size: large;">Query all columns for all American cities in the <b>CITY</b> table with populations larger than 100000. The <b>CountryCode</b> for America is USA.<span></span></span></p><a name='more'></a><p></p></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;"><span style="font-family: inherit; font-size: large;">The <b>CITY</b> table is described as follows:</span></p></blockquote><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgtmxhhFRvb3vDHlL8M5yHx0ZBh8weTsBm8lRw_9pMgMYZv9gC21H2-C4_lliWr3-dFAMRejV1RDZsYgW49xjHsXr5r7nnHWh7Sn9PONwoGEizR8h6Ot9T9ieeaaHQLYI20xH3Glh3hYleFP1m2IlJGDxfrSz-UgibP0RXzRI6k8Jm0HuROYYSxDetj" style="margin-left: 1em; margin-right: 1em;"><span style="font-size: large;"><img data-original-height="469" data-original-width="570" src="https://blogger.googleusercontent.com/img/a/AVvXsEgtmxhhFRvb3vDHlL8M5yHx0ZBh8weTsBm8lRw_9pMgMYZv9gC21H2-C4_lliWr3-dFAMRejV1RDZsYgW49xjHsXr5r7nnHWh7Sn9PONwoGEizR8h6Ot9T9ieeaaHQLYI20xH3Glh3hYleFP1m2IlJGDxfrSz-UgibP0RXzRI6k8Jm0HuROYYSxDetj=s16000" /></span></a></div><div style="font-size: x-large;"><span style="font-size: large;"><br /></span></div><span style="color: #2b00fe; font-size: x-large;"><b>ANS:</b> </span></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><div style="text-align: left;"><span style="font-size: large;"><span style="color: #2b00fe;">SELECT ID, NAME, COUNTRYCODE, DISTRICT, POPULATION FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE='USA'</span></span></div></blockquote><div><br /></div>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-35960296389218889472022-01-12T01:03:00.012+05:302022-09-09T03:02:43.818+05:30jQuery : Get Distinct Comma Separated Value From ArrayList <div class="separator" style="clear: both; text-align: center;"><br /></div><p>let array = [</p><p> { "name": "Ajay", "age": 17 },<span></span></p><a name='more'></a><p></p><p> { "name": "Bobby", "age": 17 },</p><p> { "name": "Sandy", "age": 35 }</p><p>];</p><p>array.map(item => item.age)</p><p> .filter((value, index, self) => self.indexOf(value) === index)</p><p><br /></p><p> [17, 35]</p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-75031104778306024632021-08-27T14:41:00.001+05:302021-08-27T14:41:11.899+05:30convert json to dataset then convert to json<p> //Replacing the Special Charactor </p><p> DataSet ds = JObject.Parse(response.Content)["Result"].ToObject<DataSet>();</p><p> ds.Tables[0].AsEnumerable().Where(dr => dr.Field<string>("SiteName").Contains("'")).Select(b => b["SiteName"] = b["SiteName"].ToString().Replace("'", @"\'")).ToList();</p><p> ds.Tables[1].AsEnumerable().Where(dr => dr.Field<string>("Name").Contains("'")).Select(b => b["Name"] = b["Name"].ToString().Replace("'", @"\'")).ToList();</p><p><br /></p><p> resultview = new Resultview<DataSet>(ds, Message.Success.ToString(), "Success");</p><p> return JsonConvert.SerializeObject(resultview);</p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-31704415362544526592021-07-12T18:55:00.003+05:302021-07-12T18:55:29.389+05:30How I get SQL ISO8601(SQL 126) DateTime Format<p> SQL 126<span style="white-space: pre;"> </span> | yyyy-mm-ddThh:mi:ss.mmm | ISO8601 DateTime Format</p><p><br /></p><p>Declare @ADate Date,</p><p> @ATime Time</p><p><br /></p><p>Select @ADate='2021-07-12', @ATime='9:05 AM'</p><p><br /></p><p>Select @ADate AS ADate, @ATime AS ATime</p><p><br /></p><p>SELECT CONVERT(VARCHAR, CAST(CONVERT(Varchar(15), @ADate, 112) + ' ' + CONVERT(Varchar(8), @ATime) AS DATETIME), 126) AS [SQL ISO8601 DateTime Format]</p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-62825941746559587592021-04-01T23:06:00.003+05:302021-04-24T23:25:40.281+05:30What is the Vision Of .Net?<p></p><div class="separator" style="clear: both; text-align: left;"><span style="font-family: arial;">Any Device, Any Application, Any Place We should be able to communicate is the big vision of dot net.</span></div><span><a name='more'></a></span><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7ZX_1vajv8Vvs1YCIQygsh2_LndjXp0thXP-Lji_rodMGDj4o7SkUE8QPt_ggoPthfQ7K-mStC2-rN0srdqAUdjCjbmFK0jq6b_NEUwqEdneKbPVHfyUSu04O-AAbhZ4hUk2IubCyjJQ/s1080/.Net+Vision.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1080" data-original-width="1080" height="502" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7ZX_1vajv8Vvs1YCIQygsh2_LndjXp0thXP-Lji_rodMGDj4o7SkUE8QPt_ggoPthfQ7K-mStC2-rN0srdqAUdjCjbmFK0jq6b_NEUwqEdneKbPVHfyUSu04O-AAbhZ4hUk2IubCyjJQ/w502-h502/.Net+Vision.png" width="502" /></a></div><br /> <p></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com1tag:blogger.com,1999:blog-6259191653750579456.post-14742792525250305892021-03-25T10:37:00.003+05:302021-04-24T23:26:03.185+05:30Beware of Fake Offers and Hoax calls from fraudsters / miscreants<p> </p><table style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; width: 600px;"><tbody><tr><td style="font-family: Roboto, RobotoDraft, Helvetica, Arial, sans-serif; margin: 0px; text-align: justify;"><p>प्रिय ग्राहक,</p><p>कृपया ऑनलाइन धोखाधड़ी / कपटपूर्ण प्रयासों के प्रति सावधान रहें । धोखाधड़ी की कुछ मिलती-जुलती घटनायें / कपटपूर्ण प्रयास और जालसाजों से बचाव के कुछ उपाय निम्न प्रकार हैं:<span></span></p><a name='more'></a><p></p><p><strong>केस</strong><strong>-1</strong>. एक व्यक्ति को अनजान व्यक्ति से जो कि अपने आपको सरकारी चिकित्साकर्मी बता रहा है, का फोन कॉल आया जो कि ग्राहक से कोविड-19 टीकाकरण की अग्रिम बुकिंग के लिए आग्रह कर रहा है । यह अनजान व्यक्ति, उसे मेसेज द्वारा भेजे गए लिंक को खोल कर उसमें अपनी व्यक्तिगत सूचना यथा नाम, जन्म दिनांक, बैंक खाते के नंबर संबंधी सूचना भरने और सत्यापन के लिए ओटीपी बताने का आग्रह कर रहा है ।<br /><strong><u>सही विकल्प निम्न प्रकार है:</u></strong><br />अनजान व्यक्ति से प्राप्त लिंक नहीं खोलना चाहिए व बैंक खाते की किसी भी प्रकार की सूचना, पिन और ओटीपी आदि नहीं बताना चाहिए । फोन काट देना चाहिए व इस प्रकार के लिंक को भी हटा देना चाहिए। कोई भी सरकारी चिकित्साकर्मी कोविड-19 टीकाकरण की अग्रिम बुकिंग के लिए नागरिकों को फोन करने के लिए अधिकृत नहीं है ।</p><p><strong>केस</strong><strong>-2</strong>. एक बैंक ग्राहक को अनजान व्यक्ति से फोन आया है और वह ग्राहक से अपनी के.वाई.सी सूचना शीघ्र अधतन कराने का आग्रह कर रहा है । यह अनजान व्यक्ति अपने आप को ब्रांच मैनेजर कह रहा है और ग्राहक को अपना नाम, जन्म दिनांक, एटीएम कार्ड नंबर, कार्ड एक्स्पायरी डेट व सत्यापन के लिए ओटीपी देने का आग्रह कर रहा है । ग्राहक के आनाकानी करने पर वह ग्राहक के मन में घबराहट पैदा करने का प्रयास करता है और एटीएम कार्ड ब्लॉक करने की धमकी भी देता है ।<br /><strong><u>सही विकल्प निम्न प्रकार है:</u></strong><br />अन्य व्यक्ति को किसी भी प्रकार की सूचना और ओटीपी नहीं बताना चाहिए । बैंक स्टाफ कभी भी फोन पर ग्राहक से संवदेनशील सूचना नहीं मांगते हैं । यह फ्रॉड कॉल हो सकती है, फोन करने वाला व्यक्ति कोई जालसाज हो सकता है जो कि दी गई सूचना का दुरुपयोग कर ग्राहक के खाते से राशि निकाल कर धोखाधड़ी कर सकता है ।</p><p><strong>केस</strong><strong>-</strong><strong>3</strong>. एक ग्राहक को अनजान व्यक्ति से फोन प्राप्त होता है जो कि उन्हें कम ब्याज पर, बिना पेपर औपचारिकताओं के मोबाइल पर भेजे गए लिंक में सूचना भरने के आधार पर बड़ी राशि का लोन देने का लालच / प्रस्ताव देता है। ग्राहक द्वारा इस प्रकार प्राप्त लिंक में सूचना भरने के पश्चात, एक अन्य अनजान व्यक्ति का फोन उसके पास आता है जो कि अपने-आप को नामी फ़ाइनेंस कंपनी का प्रबंधक बताते हुए लोन राशि जमा करने व वेरिफिकेशन पूरा कराने हेतु बैंक खाते की सूचना के साथ ओटीपी की मांग कर रहा है ।<br /><strong><u>सही विकल्प निम्न प्रकार है:</u></strong><br />किसी अनजान व्यक्ति से प्राप्त इस प्रकार की फोन वार्तालाप / संदेश / लिंक पर भरोसा नहीं करना चाहिए । कोई भी नामी वित्तीय संस्थान, जिसमें बैंक भी सम्मिलित है, यथोचित पहचान-प्रक्रिया पूर्ण किए बिना लोन नहीं देते हैं - इस तथ्य पर प्रत्येक व्यक्ति को विश्वास करना चाहिए । कभी भी बैंक खाते की सूचना, ओटीपी व पिन किसी को नहीं बताएं ।</p><p>कृपया अनजान व्यक्ति से प्राप्त अवांछित कॉल / ईमेल / मेसेज जिसमें लालचपूर्ण प्रस्ताव यथा लॉटरी, पुरस्कार राशि व शीघ्र लोन के लिए प्रोसेसिंग शुल्क जमा करने आदि के लिए कहा जा रहा हो, की उपेक्षा करें व उन पर ध्यान नहीं देवें ।</p><p>शुभकामनाओं सहित,</p><p>महाप्रबन्धक<br />भारतीय स्टेट बैंक<br />कॉर्पोरेट केंद्र<br />जयपुर</p></td></tr><tr><td style="font-family: Roboto, RobotoDraft, Helvetica, Arial, sans-serif; margin: 0px; text-align: justify;"><p><strong>Dear Customer,</strong></p><p>Be careful of attempts of online cheating and forgery. Please find below some of the typical cheating cases / attempts and the suggested measures to avoid falling prey to fraudsters:</p><p><strong>Case</strong><strong>-1. A person received a phone call from a stranger posing himself as Govt Medical staff asking for advance booking of Covid-19 Vaccine on Govt rates. The stranger asked the customer to open the Link sent to him on his mobile via text message and fill up the information relating to his Name, Date of Birth, Bank account details and provide the OTP sent to his mobile for Verification.</strong></p><p><strong><u>Correct choice should be as under:</u></strong><br />One should not open the link and should not share any information about bank account and OTP / PIN etc. One should immediately disconnect the phone call and remove the link. No Medical Staff from Govt. is supposed to call citizens for advance booking of Covid-19 Vaccine.</p><p><strong>Case-2. A customer of a Bank received a phone call from a stranger for updating KYC details in bank account immediately. The person was introducing himself as Branch Manager. The so-called Branch Manager asked him for his name, Date of Birth, ATM Card Number, Card expiry date and OTP. The so-called Branch Manager was creating panic on the pretext of Blocking of ATM Card immediately if KYC details and OTP are not provided to him.</strong></p><p><strong><u>Correct choice should be as under:</u></strong><br />Never share any information and OTP with any other person. Bank staff never calls to obtain sensitive information from any customer over phone. This may be a fraud call and the fraudster may cheat customer by transferring money from customer’s Bank account.</p><p><strong>Case-3. A customer receives a call from a stranger offering high amount of loan on nominal interest without paper formality after filling up information in the link sent with the message. Immediately after filling up the information, customer receives a call from other stranger introducing himself as Manager of a reputed finance company asking for information about Bank account and OTP for verification before disbursement of the loan.</strong></p><p><strong><u>Correct choice should be as under:</u></strong><br />One should never rely on such calls / messages / links received from strangers. One should believe the fact that none of reputed financial institutions including Banks disburse loans without proper identification and due diligence. Never share Bank account information / OTP or PIN with any other person. </p><p>Please avoid such phone calls, text messages and emails received from strangers offering you Lottery / Prize / Gift / Loans / attractive job offers and many such lucrative offers.</p><p>With Best Wishes,</p><p>General Manager<br />State Bank of India<br />Corporate Centre<br />Jaipur</p> </td></tr><tr><td style="font-family: Roboto, RobotoDraft, Helvetica, Arial, sans-serif; margin: 0px;"><p style="text-align: justify;"><strong><span face="Calibri, sans-serif" style="color: red; font-size: 9pt;">Disclaimer:</span></strong><span style="color: red; font-size: 9pt;"> State Bank never sends e-mails and embedded links asking you to update or verify confidential, personal and security details. If you receive such emails/phone calls/SMS, NEVER RESPOND to them and report such matter to the bank at <a href="mailto:report.phishing@sbi.co.in" style="color: #1155cc;" target="_blank">report.phishing@sbi.co.in</a></span></p><p style="text-align: justify;"><strong><span face="Calibri, sans-serif" style="color: red; font-size: 9pt;">NOTE: This is a system generated mail so please do not reply to this mail.</span></strong></p><p style="text-align: justify;"><strong></strong></p><div class="separator" style="clear: both; text-align: center;"><strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsDbRd5_n1Ukr4yHnF04QzT6R2aAck04nv23oGRAJa0bpemo5cKx3UCHDIyuQoUcXe4WL2GnT5o2RYs0Om_J4CzJg2Hj4ZqLROJIPkLWnSqbEtszoOpCrqiwhjpJ1I44zgjA6ywtvXZcM/s2048/0001.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1581" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsDbRd5_n1Ukr4yHnF04QzT6R2aAck04nv23oGRAJa0bpemo5cKx3UCHDIyuQoUcXe4WL2GnT5o2RYs0Om_J4CzJg2Hj4ZqLROJIPkLWnSqbEtszoOpCrqiwhjpJ1I44zgjA6ywtvXZcM/w495-h640/0001.jpg" width="495" /></a></strong></div><strong><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHuj4dHVaPMgqrFXfWxK5PYQmHm3dKr8o14fvaoMZW2Y-cjaG-naHMHhV3nosnVS7xzF-Hso9Q7DGUSudMpz-7VdIeUaKs_JxzvZZh5AVrp008QFuvUMWEExuOYRibNW-KzIRFamxL2Wo/s2048/0002.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1581" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHuj4dHVaPMgqrFXfWxK5PYQmHm3dKr8o14fvaoMZW2Y-cjaG-naHMHhV3nosnVS7xzF-Hso9Q7DGUSudMpz-7VdIeUaKs_JxzvZZh5AVrp008QFuvUMWEExuOYRibNW-KzIRFamxL2Wo/w495-h640/0002.jpg" width="495" /></a></div><br /><span face="Calibri, sans-serif" style="color: red; font-size: 9pt;"><br /></span></strong><p></p></td></tr></tbody></table>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-63913294209095292372021-03-13T23:40:00.009+05:302021-04-24T23:29:06.116+05:30SQL Interview Question : Find the output of<p> DECLARE @EMP_ID BIGINT=NULL</p><p>IF(@EMP_ID = NULL)</p><p>BEGIN</p><p> PRINT 'PLEASE ENTER VALID EMPLOYEE ID'</p><p>END</p><p>ELSE</p><p>BEGIN</p><p> PRINT 'VALID EMPLOYEE ID'</p><p>END<span></span></p><a name='more'></a><span></span><p></p><!--more--><p></p><p><br /></p><p>Ans : VALID EMPLOYEE ID</p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxgmlm-jlRy2ieFw0Hy67f-utL7vaDSu_Vq4IYDAnjW3XhCyRmbb_MqnI6YZOL4stytQV3Am0nQXPD6p1Vezae5T69k9PKzBUk4myGHGwevlOXAuJDnbCh-9H092zSFPon1eRI0Jc0yUY/" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="329" data-original-width="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxgmlm-jlRy2ieFw0Hy67f-utL7vaDSu_Vq4IYDAnjW3XhCyRmbb_MqnI6YZOL4stytQV3Am0nQXPD6p1Vezae5T69k9PKzBUk4myGHGwevlOXAuJDnbCh-9H092zSFPon1eRI0Jc0yUY/s16000/image.png" /></a></div><br /><br /><p></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-22439678654284873142021-03-13T23:14:00.007+05:302021-04-24T23:28:26.104+05:30SELECT COUNT(*) + COUNT(*)<p> - COUNT always returns an int data type value.</p><p> - COUNT(*) returns the number of items in a group. This includes NULL values and duplicates.<span></span></p><a name='more'></a><p></p><p>Thus, since you didn't provide a table to do a COUNT from, the default (assumption) is that it returns a 1.</p><p>So, the output of SELECT COUNT(*) + COUNT(*) is 2.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_kJjU4kq51nhcbZj0wfSSQaldgLT_zISp3QniLaT3lC9M3qjuKA3pstnCAu05Nkqfdocsffw3KyKclYhjDFYcyGDCxzNStRVvyjf5qmbiZr3Hh3XKI43RSNAn6XF5s4oVEgHNYAiXImU/" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="203" data-original-width="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_kJjU4kq51nhcbZj0wfSSQaldgLT_zISp3QniLaT3lC9M3qjuKA3pstnCAu05Nkqfdocsffw3KyKclYhjDFYcyGDCxzNStRVvyjf5qmbiZr3Hh3XKI43RSNAn6XF5s4oVEgHNYAiXImU/s16000/image.png" /></a></div><br /><br /><p></p>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0tag:blogger.com,1999:blog-6259191653750579456.post-77832362558053594082020-10-14T19:45:00.003+05:302020-10-14T19:55:03.490+05:30What is name of text editor in window to type your SQL queries?<div class="mbtTOC">
<button onclick="mbtToggle()">Table Of Contents</button>
<br />
<ul id="mbtTOC"></ul>
</div>
<p>If you want to edit only SQL Queries. Then you can use in-built editor like "Notepad". There is no specific SQL Query editor pre installed in window OS.</p><p>There is many SQL Editor's are available now days. But I prefer to use "SQL Server Management Studio (SSMS) Query Editor" to edit quires.<span></span></p><p><br /></p><a name='more'></a> <p></p>
<h2 style="text-align: left;"><u>What is SQL editor?</u></h2><p>SQL Editor is one of the editors within Zen Control Center (ZenCC). The editor allows you to run Structured Query Language (SQL) statements in a Zen database. You may use SQL to retrieve, create, change, or delete data in a database so long as you have database permissions to perform these actions.</p><p><br /></p><h2 style="text-align: left;"><u>Important Things with SSMS Query Editor</u></h2><p>The text editor implements the base level of functionality and can be used as a basic editor for text files. The other editors, or query editors, extend this functionality base by including a language service that defines the syntax of one of the languages supported in SQL Server. </p><p>The query editors also implement varying levels of support for editor features such as IntelliSense and debugging. </p><p>The query editors include the Database Engine Query Editor for use in building scripts containing T-SQL and XQuery statements, the MDX editor for the MDX language, the DMX editor for the DMX language, and the XML/A editor for the XML for Analysis language. </p><p>You can use the Query Editor to create and run scripts containing Transact-SQL statements.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2I9zMfw0qS8VDAHefyFPRt6qKKr1DnWpGfGfCdLY177XM8BsxatZ2tdd1AEPyUTon8W6NOws-DCQZ9s0gzQXdzDwPfX_olPy67dEZRnQzjzjONKd5i1AJltL7TG4aeLYBKzUGthddKBo/s729/SQLEditor.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="729" data-original-width="628" height="597" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2I9zMfw0qS8VDAHefyFPRt6qKKr1DnWpGfGfCdLY177XM8BsxatZ2tdd1AEPyUTon8W6NOws-DCQZ9s0gzQXdzDwPfX_olPy67dEZRnQzjzjONKd5i1AJltL7TG4aeLYBKzUGthddKBo/w514-h597/SQLEditor.jpg" width="514" /></a></div><div><br /></div><br /><h2 style="text-align: left;"><u>List of 20 Best SQL Editor Tools</u></h2><p></p><ol style="text-align: left;"><li>Microsoft SQL Server Management Studio</li><li>SQLite Studio</li><li>MySQL Workbench</li><li>Oracle SQL Developer</li><li>Adminer</li><li>PopSQL</li><li>Cluvio</li><li>TablePlus</li><li>Toad for SQL Server</li><li>dbForge Studio</li><li>DBeaver</li><li>HeidiSQL</li><li>datapine SQL Editor</li><li>DatabaseSpy SQL Editor</li><li>RazorSQL</li><li>SQuirreL SQL</li><li>Aqua Data Studio</li><li>Postico</li><li>WinSQL</li><li>Valentina Studio</li></ol><div><span style="font-size: x-small;">Content Reference : Google Search, Microsoft Official, financesonline.com</span></div><script>mbtTOC();</script>Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com2tag:blogger.com,1999:blog-6259191653750579456.post-9476953446228659042020-09-17T11:43:00.000+05:302020-09-17T11:43:59.360+05:30FastStone Capture Full Serial Key<div dir="ltr" style="text-align: left;" trbidi="on">
Registration Code<br />
Name : www.xyraclius.com<br />
Serial : OOCRYIMDMDPWRETFPSUZ</div>
Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com15tag:blogger.com,1999:blog-6259191653750579456.post-50184625657385137472020-09-13T02:55:00.000+05:302020-09-13T02:59:09.307+05:30OOP's Interview Question: What is OOP in C#?<div dir="ltr" style="text-align: left;" trbidi="on">
Here i am discussing about, "<b>OOP's related inter question's are asked up to fresher level</b>".<br />
<a name='more'></a><br />
<br />
<div class="mbtTOC">
<button onclick="mbtToggle()">Table Of Contents</button>
<br />
<ul id="mbtTOC"></ul>
</div>
<h2 style="text-align: left;">
What is OOP in C#?</h2>
<ol style="text-align: left;">
<li><b>C#</b> is an <b>Object Oriented Programming</b> language.</li>
<li><b>OOP</b> includes <b>classes, objects, overloading, encapsulation, data hiding,</b> and <b>inheritance</b>.</li>
<li>The fundamental idea behind <b>OOP</b> is to <b>combine into a single unit both data and the methods</b> that operate on that data, such units are called an object.</li>
<li>All <b>OOP</b> languages provide mechanisms that help you implement the object-oriented model. They are <b>encapsulation, inheritance, polymorphism</b> and <b>reusability</b>.</li>
</ol>
<div>
<br /></div>
<h2 style="text-align: left;">
What is Object Oriented Programming in C#?</h2>
<div>
<ol style="text-align: left;">
<li><b>OOP</b> stands for <b>Object-Oriented Programming</b>.</li>
<li><b>OOP</b> is a <b>Procedural programming</b> is about writing <b>procedures or methods</b> that <b>perform operations on the data, <br />while object-oriented programming</b> is about <b>creating objects that contain both data and methods</b>.</li>
</ol>
<div>
<div>
<br /></div>
<h2 style="text-align: left;">
Why C# is Object Oriented Programming?</h2>
<div>
<ol style="text-align: left;">
<li><b>C#</b> provides <b>full support</b> for <b>Object-Oriented Programming.</b></li>
<li><b>C# </b>includes <b>abstraction, encapsulation, inheritance, and polymorphism</b>.</li>
<li><b>Abstraction</b> <b>means hiding the unnecessary details from type consumers</b>.</li>
<li><b>Encapsulation</b> <b>means </b>that <b>a group of related properties, methods, and other members are treated as a single unit or object</b>.</li>
</ol>
<div>
<h2 style="text-align: left;">
Summary</h2>
<div>
Knowing these sample questions are asked up to fresher level. <b>Simple techniques can make your code easier to understand & simpler to read.</b> Hope this will helpful for you. If there any confusion. Please comment. I will help you.</div>
</div>
</div>
</div>
</div>
<script>mbtTOC();</script>
</div>
Ajay Gangwarhttp://www.blogger.com/profile/14009765316478099730noreply@blogger.com0