Dear Experts,
Thanks for your time and help.
I am using oracle in my application with ASP.NET and C#,
My query is ok but it is going to ELSE Condition.
(Goes to green line)
Please Help me to solve this issu.
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="Encryption"%>
<%
string rno=Request.QueryString["row_no"];
string pass=Request.Form["pass"];
pass=Encrypt.EncryptText(pass);
// Response.Write(Encrypt.DecryptText("ëáëáìá");
OleDbConnection conn=new OleDbConnection(System.Configuration.ConfigurationManager.AppSettings["MM_CONNECTION_STRING_ictmdb"]);
conn.Open();
//OleDbCommand comm=new OleDbCommand("select count(*) cc from ictm_pass where password='"+pass+"'",conn);
OleDbCommand comm = new OleDbCommand("select count(*)cc from ictm_new_company where password='" + pass + "'", conn);
OleDbDataReader dr=null;
bool delete=false;
try{dr=comm.ExecuteReader();
if(dr.Read()){
int cc=0;
cc=Convert.ToInt32(dr["cc"]);
dr.Close();
Response.Write( "<Br>");
if(cc>0) {
// comm=new OleDbCommand("company.delete_registered_company",conn);
// comm.CommandType=CommandType.StoredProcedure;
OleDbParameter prm=comm.Parameters.Add("@row_no",OleDbType.Double);
prm.Value=rno;
comm.ExecuteNonQuery();
delete=true;
}
}
}catch(Exception ex){Response.Write(ex.ToString()+"<br>");}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link href="../../../../../css/ee.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<table width="600" border="0" cellpadding="4" cellspacing="2">
<tr>
<td class="head importantdata">Deletion of Company Registration.</td>
</tr>
<tr>
<td class="data"><%if(delete){%>
The Company <%=Request.QueryString["company_name"]%> is deleted.
<%}else{%>
The Company <%=Request.QueryString["company_name"]%> is not deleted because the password is wrong.<%}%>
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
window.opener.window.location.href='../comp1.aspx';
</script>
<%
conn.Close();
%>