Sunday, 15 April 2018
Friday, 30 March 2018
Fixing the "ng is not recognized" Error in Angular
Problem: When trying to run an Angular project using the "ng serve" command, you encounter an error that says "ng: The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
Solution: To resolve this error, open the command prompt and type "npm -i -g @angular/cli" to install the Angular CLI globally. Once the installation is complete, navigate to the project directory and run the project using "ng serve" command. This should allow you to run your Angular project without encountering the "ng is not recognized" error.
Tuesday, 16 May 2017
what is difference between ienumerable and iqueryable?
but there is most of the difference between them.
when we talk about ienumerable there is a collection. means that it works on in object. For example if we are work on collection then ienumerable is working fine because it collect all data from database to client browser first and after that filteration will be applied
For example if we want to fetch first 3 records from the database whose gender is male
then ienumerable first fetch all data from db and after that it apply filteration. thatswhy it is slow in comparision to iqueryable.
and if we talk about iqueryable then it works on network related data. this apply all filteration on server side and after that it fetch data from there thatswhy it is fast.
Tuesday, 29 November 2016
You can also contact on this number-9910567004 and 8003698602 if you want to try this medicine.
Wednesday, 23 November 2016
Last day the speech of Our PM shri narender modi is really a very heart touching and he is the first PM that cries in assembly he fight the corruption, he take very really good decision about demonetization. I think this is a very good way because everywhere in our country in this day every one people out of four are talking about this daring decision of our PM. or this is really very good because before this demonetization when we read newspaper, watching news channel every where is news about corruption, theft, snitching and terrorism but after 8 November this type of news are gone away from the news channel and new era is coming.
Friday, 23 October 2015
how to call ajax with Jquery using Asp.net
Many of the times the interviewer asked the question that how to call how to call server side method as a client side in Asp.net.
so the answer is using jquery we can use server side method via client side:
here is example for this.
first of all create a sample web application in visual studio
1. visual studio 2012->new project - web application .
now on default.aspx page write the following code in body tag.
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
<input id="btnGetTime" type="button" value="Show Current Time" onclick="ShowCurrentTime()" />
after that call the jquery within head section like this ..
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function ShowCurrentTime()
{
$.ajax({
type: "POST",
url: "WebForm1.aspx/GetCurrentTime",
data: '{name:"' + $("#<%=txtUserName.ClientID%>")[0].value + '"}',
contentType: "application/json;charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (responce) {
alert(responce.d);
}
});
}
function OnSuccess(responce) {
alert(responce.d);
}
</script>
you can see easily the above code
in the first line we reference the jquery file user can also download this jquery and reference it to locally.
now in function ShowCurrentTime() we make ajax call here $.ajax is signature for call ajax method
here type may be post or get according to user requirement.
now it is main part on default.aspx.cs page make method to as webmethod which is necessary to call server method on client side
[System.Web.Services.WebMethod]
public static string GetCurrentTime(string name)
{
return " Hello " + name + Environment.NewLine + "The Current Time is :" + DateTime.Now.ToString();
}
You can test this demo and enjoy..
Tuesday, 6 October 2015
How to count the occurence of a string counted without using for loop in a sentence.
first of all we use a name space using System.Text.RegularExpressions
then take a sample string here i take this
string s="One reason people lie is to achieve personal power. Achieving personal power is helpful for someone who pretends to be more confident than he really is. For example, one of my friends threw a party at his house last month. He asked me to come to his party and bring a date. However, I didn’t have a girlfriend. One of my other friends, who had a date to go to the party with, asked me about my date. I didn’t want to be embarrassed, so I claimed that I had a lot of work to do. I said I could easily find a date even better than his if I wanted to. I also told him that his date was ugly. I achieved power to help me feel confident; however, I embarrassed my friend and his date. Although this lie helped me at the time, since then it has made me look down on myself."
Now the code for counting the purticular string
int count=Regex.Matches(s.ToUpper(), "THE").Count;
and now print on console like this
Console.WriteLine(count);
Thursday, 17 September 2015
How to Remove Comma Character from the Last of string.
AdSense
The Ultimate Guide to Interceptors: Understanding Their Power and Functionality
The Ultimate Guide to Interceptors: Understanding Their Power and Functionality An interceptor is a service that can intercept HTTP reques...
-
When working on an existing Angular project, I typically review all the project details and execute the "npm install" command in t...
-
Fixing Console Error: Troubleshooting Loom Chrome Extension for Running Projects ...
-
Most of the angular developer face the above problem when they are dealing with Reactive forms "Must supply a value for form control...