How many web.Config can be in web application?
In an application we can have no. of web config file but they must be in Different Directory . By default only one in an application.
count length of word without using inbuilt functions in c#
int myOwnGetStringLength(String str)
{
int count = 0;
foreach(Char c in str)
count++;
return count;
}
{
int count = 0;
foreach(Char c in str)
count++;
return count;
}
other way
private int stringLength(string str) {
int length = 0;
bool done = false;
do {
try {
char c = str[length];
length++;
} catch (IndexOutOfRangeException) {
done = true;
}
} while(!done);
return length;
}
int length = 0;
bool done = false;
do {
try {
char c = str[length];
length++;
} catch (IndexOutOfRangeException) {
done = true;
}
} while(!done);
return length;
}
A prime number is a natural number that has only one and itself as factors.
#include <stdio.h>
- main() {
- int n, i, c = 0;
- printf("Enter any number n: ");
- scanf("%d", &n);
- /*logic*/
- for (i = 1; i <= n; i++) {
- if (n % i == 0) {
- c++;
- }
- }
- if (c == 2) {
- printf("n is a Prime number");
- }
- else {
- printf("n is not a Prime number");
- }
return 0;}
HTTP Methods: GET vs. POST
Two commonly used methods for a request-response between a client and server are: GET and POST.
- GET - Requests data from a specified resource
- POST - Submits data to be processed to a specified resource
Some other notes on GET requests:
- GET requests can be cached
- GET requests remain in the browser history
- GET requests can be bookmarked
- GET requests should never be used when dealing with sensitive data
- GET requests have length restrictions
- GET requests should be used only to retrieve data
----------------------------------------------------------------------------------------------------------------------------
Some other notes on POST requests:
- POST requests are never cached
- POST requests do not remain in the browser history
- POST requests cannot be bookmarked
- POST requests have no restrictions on data length
gridview(web) and datagrid.(window)
No comments:
Post a Comment