Posts

Showing posts from November, 2015

Edit all rows of gridview on button click which is outside gridview

Image
I have a "Submit Objection" button in my page. on click of the edit button i want Owner Name. My gridview is in a web user control and button on an aspx page. The Code behind design: Here the fire event of Submit Objection button:    The Code behind Submit Objection code is: For More Help: Follow the link  edit all rows of gridview on button click which is outside gridview

Return data part from SQL Server datetime(Current) datatype

In SQL Server there is following queries are as follows to get  date part only from a SQL Server datetime datatype. --Return only DATETIME part from Current DateTime in SQL Server. select (getdate()) AS DATETIME --Return only YEAR part from Current DateTime in SQL Server. select YEAR(GETDATE()) AS YEAR --Return only MONTH part from Current DateTime in SQL Server. select MONTH(GETDATE()) AS MONTH  --Return only DAY part from Current DateTime in SQL Server. select DAY(GETDATE()) AS DAY --Return Date, datatype which contains only a date with no time from Current DateTime in SQL Server. SELECT CONVERT(date, getdate()) SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) select cast(getdate() as date) --This returns DATE as 'yyy/mm/dd' format: SELECT CONVERT(VARCHAR(10),GETDATE(),111) -- NOTE: 111 is the Japanese format. yyy/mm/dd --This returns DATE as 'mm/dd/yyyy' format: SELECT CONVERT(VARCHAR(10),GETDATE(),101)  -- NOTE: 101 is the Japanese fo...

SQL Basic: SQL Data Types

Image
SQL Data Type: is an attribute that specifies type of data of any object.  In each column, variable and expression has related data type in SQL. There is categories of data types in SQL Server as follows:  Exact Numeric Data Types Approximate Numeric Data Types Date and Time Data Types Char-Strings Data Types Unicode Char-Strings Data Types Binary Data Types Misc Data Types अन्य महत्वपूर्ण लिंक : Asp.Net & c#:Change message of Control page on change language of website , SQL INTRODUCTION Why SQL? SQL Commands SQL Commands (DDL,DML,DCL) SQL Syntax Important thing Keep Mind it.... SQL SELECT Command SQL DISTINCT Statement SQL WHERE Condition SQL OPERATORS ( AND & OR ) SQL ORDER BY SQL INSERT INTO Command SQL UPDATE Command SQL DELETE Command SQL Basic: SQL Data Types

Change message of Control page on change language of website

Image
कंट्रोल पेज(exapmle.ascx) पर स्क्रिप्ट मैसेज को हिंदी में करने के लिये: उस कंट्रोल पेज(exapmle.ascx) पर इस प्रकार स्क्रिप्ट को लिखेंगे।   उस कंट्रोल पेज(exapmle.ascx) पर एक HiddenField को ऐड करेंगे ।  उस कंट्रोल के कोड पेज(exapmle.ascx.cs) पर HiddenField की Property बनाकर HiddenField की value set करेंगे । Note : Property का नाम HiddenField के same नहीं होगा।  कंट्रोल पेज(exapmle.ascx) के पैरेंट पेज(exapmle.aspx) के कोड पेज(exapmle.aspx.cs) पर कंट्रोल पेज(exapmle.ascx) पर बनाई गयी Property को access करके उसमे सेशन बदलने के साथ value सेट कर देंगे।  इस प्रकार आप चयनित भाषा के अनुरूप आप मैसेज को दिखा सकते है।  यह कोड कंट्रोल पेज के लिए है।   अन्य महत्वपूर्ण लिंक : Asp.Net & c#:Change message of Control page on change language of website , SQL INTRODUCTION Why SQL? SQL Commands SQL Commands (DDL,DML,DCL) SQL Syntax Important thing Keep Mind it.... SQL SELECT Command SQL DISTINCT Stateme...

My Bisalpur- Introduction

Image
Bisalpur Map BISALPUR              Bisalpur is a city. It belongs to Bareilly Division. As well as a municipal board in the Pilibhit district of Uttar Pradesh state, India. It is located 45 KM in South from district head quarters Pilibhit. This is surrounded by lush green meadows scattered all around. The town is famous for its Sugar Factory and the Ram Leela Dushera festival held every year. There are various historical places, one of the most famous is The Duve Talab, which is approximately 200 years old. It is a Tehsil head quarter. Geographic Location of Bisalpur Bisalpur located at 28°18′N 79°48′E / 28.3°N 79.8°E. It has an average elevation of 156 metres (511 feet). Bisalpur is famous for its Sugar Factory and Very famous Distances between Bisalpur to Bareilly and Pilibhit, is 43km and 38 km respectively. Place : Bisalpur PIN Code 262201 District : Pilibhit Tehsil/ Taluka : Bisalpur State...

My Bisalpur- Population

Population The city is divided into 25 wards for which elections are held every 5 years. The Bisalpur Nagar Palika Parishad has population of 73,551 of which 38,858 are males while 34,693 are females as per report released by Census India 2011. Population of Children with age of 0-6 is 10242 which is 13.93 % of total population. In Bisalpur, Female Sex Ratio is of 893 against state average of 912. Moreover Child Sex Ratio in Bisalpur is around 913 compared to Uttar Pradesh state average of 902. Literacy rate of Bisalpur city is 61.65 % lower than state average of 67.68 %. Male literacy is around 68.96 % while female literacy rate is 53.43 %. Bisalpur Religion Data 2011 Town Bisalpur Population 73,551 Hindu 53.54% Muslim   45.93% Christian 0.18% Sikh 0.01% Buddhist 0.01% Jain 0.01% Others 0.00% Not Stated 0.06% My Bisalpur Related Topic: My Bisalpur- Introdution ,   Bisalpur Population

SQL BASIC - SQL DELETE Command

Image
SQL DELETE  This statement is used to delete records in a table. SQL UPDATE Statement  The SQL update statement is used to delete row in a table. Syntax: [ To update the existing record into the table, we are using SQL UPDATE command as follows: ] DELETE FROM table_name WHERE  column_name=value; Note: WHERE clause: In SQL DELETE Statement,  WHERE clause specifies which record should be deleted. If you don't use WHERE clause,then SQL DELETE condition delete all records. Data Is Deleted Only in Specified Columns: The following statement will delete existing record as per the specifies condition in WHERE Clause. Below is existing   "Student"  table: Example 1: [we delete existing student " Anuj " from "Student" table.] The following statement are used as to delete a existing "Anuj's " record from the " Student " table : DELETE F...

SQL Basic- SQL UPDATE Command

Image
SQL UPDATE This statement is used to update records in a table. SQL UPDATE Statement  The SQL update statement is used to update existing record in a table. Syntax: [ To update the existing record into the table, we are using SQL UPDATE command as follows: ] UPDATE table_name  SET col1=value1, col2=value2  WHERE column=value; Note: WHERE clause: In SQL UPDATE Statement,  WHERE clause specifies which record should be updated. If you don't use WHERE clause,then SQL UPDATE condition update all records. Data Is Updated Only in Specified Columns: The following statement will update existing record as per the specifies condition in WHERE Clause. Below is existing   "Student"  table: Example 1: [we update existing student " Ajeet " with a new Address in "Student" table.] The following statement are used as to Update a existing "Ajeet's " record...

SQL Basic- SQL INSERT INTO Command

Image
SQL INSERT INTO This statement is used to insert new records in a table. SQL INSERT INTO Statement  The insert into statement is used to insert new record into the existing table. Syntax: There is two ways to insert data into the table:               Syn1: [ This form not specify the column names where the data will be inserted, only their values: ]         INSERT INTO table_name                  VALUES (value1, value2, value3, ...);               Syn2: [ This form specifies both the column names and the values to be inserted: ]         INSERT INTO  table_name (column1,column2,column3,...)             VALUES (value1, value2, value3, ...); Below is existing   "Student"  table: Example 1: [we...

SQL Basic- SQL ORDER BY

Image
SQL ORDER BY This is Keyword, Used to sort the result-set. SQL ORDER BY Keyword The ORDER BY keyword is used to sort the result-set by one or more columns. The ORDER BY keyword sorts the records in ascending order by default.  To sort the records in a  ascending   order, you can use the ASC keyword. To sort the records in a descending order, you can use the DESC keyword. Below is selection from  "Student"  table: Syntax: SELECT column_name FROM table_name ORDER BY column_name ASC | DESC ; Example 1: [In one column] The following statement selects all student from the "Student" table, sorted by the " Address " column: SELECT * FROM Student  ORDER BY Address; Result: Example 2: [In two column] The following statement selects all Student from the " Student " table, sorted DESCENDING by the " Address   ...

SQL Basic- SQL Operators(AND & OR)

Image
SQL Operators These Operators are used to filter record based on more than one condition. SQL AND & OR Operators AND operator displays record if the both condition are true. OR operator displays record if either the one condition is true. Below is selection from "Student" table: StudentID     Student Name        Address       Country 1     Ajay        Noida         India 2     Ajeet        Bareilly         India 3     Shivam        Nagaland         India 4     Monu        Noida         India Example: AND: SELECT * FROM Student WHERE Address='Noida' AND Country='India'; Result: StudentID     Student Name       ...

SQL Basic- SQL WHERE Condition

Image
SQL WHERE Condition: SQL WHERE Condition is used to filter records. This condition is show only those record as per specified in where condition. Syntax: SELECT column_name FROM table_name WHERE column_name operator value; Table:     'Student' StudentID             StudentName               Address                Country 1             Ajay               Noida                India 2             Ajeet               Bareilly                India 3             Shivam               Nagaland                India ...

SQL Basic- SQL DISTINCT Statement

Image
SQL DISTINCT Statement: This statement is used to show only DISTINCT values. SELECT DISTINCT Statement: In a table: A column contain many duplicate value and you want only different values from table. This statement retrieve only distinct(different) values. Syntax: SELECT DISTINCT column_name  FROM table_name; Table:     'Student' StudentID             StudentName               Address                Country 1             Ajay               Noida                India 2             Ajeet               Bareilly                India 3             Shivam     ...