<script>
function doSubmit()
{
var frm = window.document.frmName;
frm.action="path to php file";
frm.method = post;
frm.submit();
}
</script>
How can we submit a form without a submit button?
Where to change in php.ini file for file uploading?
You can call the phpinfo() function to find the location of your php.ini file, it will also tell you the current values for the following settings that we need to modify 1.file_uploads 2.upload_max_filesize 3.max_input_time 4.memory_limit 5.max_execution_time 6.post_max_size
What is the default session time in PHP and how can I change it?
Default session time in PHP is 1440 seconds. if we want to change the session time in php, then we have to change in php.ini.
What is viewstate in ASP.NET?
ViewState(”SomeVar”) = txtFirstName.text;
//Retrieve the value from ViewState object after the PostBack
String strFirstName = ViewState(”SomeVar”).ToString();
Explain the access specifiers Public, Private, Protected, Friend, Internal, Default
The main purpose of using access specifiers is to provide security to the applications. The availability (scope) of the member objects of a class may be controlled using access specifiers.1. PUBLIC
As the name specifies, it can be accessed from anywhere. If a member of a class is defined as public then it can be accessed anywhere in the class as well as outside the class. This means that objects can access and modify public fields, properties, methods.
2. PRIVATE
As the name suggests, it can’t be accessed outside the class. Its the private property of the class and can be accessed only by the members of the class.
3. FRIEND/INTERNAL
Friend & Internal mean the same. Friend is used in VB.NET. Internal is used in C#. Friends can be accessed by all classes within an assembly but not from outside the assembly.
4. PROTECTEDProtected variables can be used within the class as well as the classes that inherites this class.
5. PROTECTED FRIEND/PROTECTED INTERNAL
The Protected Friend can be accessed by Members of the Assembly or the inheriting class, and ofcourse, within the class itself.
6. DEFAULT
A Default property is a single property of a class that can be set as the default. This allows developers that use your class to work more easily with your default property because they do not need to make a direct reference to the property. Default properties cannot be initialized as Shared/Static or Private and all must be accepted at least on argument or parameter. Default properties do not promote good code readability, so use this option sparingly.
How to Update,Edit and delete a row in GridView?
public partial class _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
SqlDataAdapter da;
DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
filldata();
}
}
public void filldata()
{
string str = “select * from login”;
da = new SqlDataAdapter(str,con);
ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string uname=GridView1.Rows[0].Cells[2].Text;
string qyry = “delete from login where uname=’”+uname+”‘”;
da = new SqlDataAdapter(qyry,con);
ds = new DataSet();
da.Fill(ds);
filldata();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
filldata();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox txtunam = (TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0];
TextBox txtpassword = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
TextBox txtconfirmpwd = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
TextBox txtemail = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
//string qry = “update login set password=’”+txtpassword.Text+”‘,confirm_password=’”+txtconfirmpwd.Text+”‘,email=’”+txtemail.Text+”‘where uname=’”+txtunam.Text+”‘”;
string qryy = “update login set password=’”+txtpassword.Text+”‘,confirm_password=’”+txtconfirmpwd.Text+”‘,email=’”+txtemail.Text+”‘where uname=’”+txtunam.Text+”‘”;
da = new SqlDataAdapter(qryy, con);
ds = new DataSet();
da.Fill(ds);
GridView1.EditIndex = -1;
filldata();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
filldata();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
filldata();
}
}
———————————————————————————————————-
In .aspx side you need to add a GridView data control.
for update/delete you have to define the datakey in gridview at aspx side:
———————————————————————————————————–
<form id=”form1″ runat=”server”>
<div>
<asp:GridView ID=”GridView1″ runat=”server” AllowPaging=”True” OnPageIndexChanging=”GridView1_PageIndexChanging”
OnRowCancelingEdit=”GridView1_RowCancelingEdit” OnRowDeleting=”GridView1_RowDeleting”
OnRowEditing=”GridView1_RowEditing” OnRowUpdating=”GridView1_RowUpdating” OnSelectedIndexChanged=”GridView1_SelectedIndexChanged”
PageSize=”3″ Style=”z-index: 100; left: 0px; position: absolute; top: 0px”>
<Columns>
<asp:CommandField ShowEditButton=”True” />
<asp:CommandField ShowDeleteButton=”True” />
</Columns>
</asp:GridView>
</div>
</form>
what is pl/sql?
PL/SQL stands for Procedural Language extension of SQL.
PL/SQL supports variables, conditions, loops and exceptions. Arrays are also supported, though in a somewhat unusual way, involving the use of PL/SQL collections.
While programmers can readily embed Data Manipulation Language (DML) statements directly into their PL/SQL code using straight forward SQL statements, Data Definition Language (DDL) requires more complex “Dynamic SQL” statements to be written in the PL/SQL code. However, DML statements underpin the majority of PL/SQL code in typical software applications.
Each PL/SQL program consists of SQL and PL/SQL statements which from a PL/SQL block.
A PL/SQL Block consists of three sections:
- The Declaration section (optional).
- The Execution section (mandatory).
- The Exception (or Error) Handling section (optional).
WHAT IS TRIGGER IN ORACLE?
A trigger is a pl/sql structure which is fired when a DML statements like Insert, Delete, Update is executed on a database table. A trigger is triggered automatically when an associated DML statement is executed.
(DML-Data Manipulation Language statements are used for
managing data within schema objects…
-{select,insert,update,delete,merge,call,explain,lock table} )…
Syntax of trigger:—-
CREATE OR REPLACE TRIGGER trigger_name
AFTER DELETE OR INSERT OR UPDATE OF column_name
ON table_name
FOR EACH ROW BEGIN
sql statement END;
Types of triggers:-
1-Row trigger and Statement triggers
2-Before and After triggers
3-Instead of triggers
4-Triggers on System events and User events.
Example:–
The total_salary trigger maintains a derived column that
stores the total salary of all members in a department:
CREATE TRIGGER total_salary
AFTER DELETE OR INSERT OR UPDATE OF department_id, salary ON employees
FOR EACH ROW BEGIN
IF DELETING OR (UPDATING AND old.department_id != new.department_id)
THEN UPDATE departments
SET total_salary = total_salary – old.salary
WHERE department_id = old.department_id;
END IF;
IF INSERTING OR (UPDATING AND old.department_id != new.department_id)
THEN UPDATE departments
SET total_salary = total_salary + new.salary
WHERE department_id = new.department_id;
END IF;
IF (UPDATING AND old.department_id = new.department_id AND
old.salary != new.salary )
THEN UPDATE departments
SET total_salary = total_salary – old.salary + new.salary
WHERE department_id = new.department_id;
END IF;
END;
how we will define constant in pl/sql?
Constant is a value used in a PL/SQL Block that remains unchanged throughout the program. A constant is a user-defined literal value. You can declare a constant and use it instead of actual value.
For example: If you want to write a program which will increase the salary of the employees by 25%, you can declare a constant and use it throughout the program. Next time when you want to increase the salary again you can change the value of the constant which will be easier than changing the actual value throughout the program.
The General Syntax to declare a constant is:
constant_name CONSTANT datatype := VALUE;DECLARE
salary_increase CONSTANT number(3);
BEGIN
salary_increase := 100;
dbms_output.put_line (salary_increase);
END; ((The Declaration section of a PL/SQL Block starts with the reserved keyword DECLARE. The Execution section of a PL/SQL Block starts with the reserved keyword BEGIN and ends with END.))
what is encapsulation?
Encapsulation the ability of an object to hide its data and methods from the rest of the world. It is one of the fundamental principles of Oops.
The protection involves providing a stable interface which protects the remainder of the program from the implementation (the details that are most likely to change).
Public class Add
{
private void subtract(int x, int y)
{
return x * y;
}
}
…
…
Add obj;
int Result;
Result = obj.subtract(5,10);

