Most of the posts in this blog are the information I collected over the internet. I have looked for them for my own purpose and have posted here so that others might benefit as well
Tuesday, April 6, 2010
Sys.WebForms.PageRequestManagerParserErrorException
ASP.NET AJAX and Sys.Webforms.PageRequestManagerServerErrorException
Using ASP.NET AJAX extensively in my latest project I've been sporadically running into the Sys.WebForms.PageRequestManagerParserErrorException. It got to the point that I was contemplating ripping out ASP.NET AJAX completely until this known issue had been ironed out. The various causes for this error are mentioned many different places, but for some samples, go here, here, and here.
Wednesday, May 21, 2008
How to add a textbox inside a gridview

-------------------------------------------------------------
Just below it is the code with which you can access these individual textbox in the different rows.
-------------------------------------------------------------------------------------
for (int j = 0; j < GridView1.Rows.Count; j++)
{
Control cnt;
cnt = GridView1.Rows[j].Cells[3].Controls[1];
cnt = GridView1.Rows[j].FindControl("txtValue");
TextBox txtBx = (TextBox)cnt;
//write your code here to maniupulate the content of textbox
}
Monday, May 12, 2008
How to pass login parameter (username, password) of database to crystal report from code
using CrystalDecisions.ReportSource;
using CrystalDecisions.Shared;
using CrystalDecisions.Web;
private void displayReport()
{
try
{
CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
ConnectionInfo connInfo = new ConnectionInfo();
TableLogOnInfo tblLogInfo = new TableLogOnInfo();
TableLogOnInfos tblLogInfos = new TableLogOnInfos();
connInfo.UserID = "usrName";
connInfo.Password = "passwd";
connInfo.ServerName = "database";
tblLogInfo.ConnectionInfo = connInfo;
tblLogInfos.Add(tblLogInfo);
CrystalReportViewer1.LogOnInfo = tblLogInfos;
CrystalReportViewer1.EnableParameterPrompt = false;
CrystalReportSource1.ReportDocument.FileName=Server.MapPath ("Reports\\crystNewMain.rpt");
}
Catch
{
}
}
Saturday, May 10, 2008
How to pass parameter to crystal report from ASP.NET
Before this please do not forget to use following namespaces
using CrystalDecisions.Reporting;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Shared;
using CrystalDecisions.Web;
private void displayReport(number id,string section)
{
try
{
CrystalReportViewer1.EnableParameterPrompt = false;
ParameterFields pFields = new ParameterFields();
ParameterField pField1 = new ParameterField();
ParameterField pField2 = new ParameterField();
ParameterDiscreteValue pDisValue1 = new ParameterDiscreteValue();
ParameterDiscreteValue pDisValue2 = new ParameterDiscreteValue();
pField1.Name = "id";
pField2.Name = "section";
pDisValue1.Value = id;
pField1.CurrentValues.Add(pDisValue1);
pFields.Add(pField1);
pDisValue2.Value = section;
pField2.CurrentValues.Add(pDisValue2);
pFields.Add(pField2);
CrystalReportViewer1.ParameterFieldInfo = pFields;
}
Catch
{
}
}
Friday, April 18, 2008
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater
Cause
Security permissions were not properly set when the Oracle 9i Release 2 client was installed on Windows with NTFS. The result of this is that content of the ORACLE_HOME directory is not visible to Authenticated Users on the machine; this again causes an error while the System.Data.OracleClient is communicating with the Oracle Connectivity software from an ASP.NET using Authenticated User privileges.
Solution
To fix the problem you have to give the Authenticated Users group privilege to the Oracle Home directory.
- Log on to Windwos as a user with Administrator privileges.
- Start Window Explorer and navigate to the ORACLE_HOME folder.
- Choose properties on the ORACLE_HOME folder.
- Click the "Security" tab of the "Properties" window.
- Click on "Authenticated Users" item in the "Name" list.
- Uncheck the "Read and Execute" box in the "Permissions" list under the "Allow" column.
- Re-check the "Read and Execute" box under the "Allow" column
- Click the "Advanced" button and in the "Permission Entries" verify that "Authenticated Users" are listed with permission = "Read & Execute", and Apply To = "This folder, subfolders and files". If not, edit that line and make sure that "Apply To" drop-down box is set to "This folder, subfolders and files". This should already be set properly but it is important that you verify it.
- Click the "Ok" button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.
- Reboot, to assure that the changes have taken effect.
Thursday, April 17, 2008
Running a stored procedure from ASP dot net
PROCEDURE PRC_VALIDATEUSER(usrName in VARCHAR,usrPwd in VARCHAR,
,usrValid out NUMBER) AS
BEGIN
/*…………*/
END;
Now in C# we write code the following way
Public Boolean validateUser(string pusrname,string pusrpass)
{
Try
{
OracleConnection con = new OracleConnection(appParams.connString);
//instead of appParams.connString use connection string for your database
con.Open();
sql = " begin validateuser(:uName,:uPasswd,:uValid); end;";
OracleParameter p1 = new OracleParameter();
p1.OracleType = OracleType.VarChar;
OracleParameter p2 = new OracleParameter();
p2.OracleType = OracleType.VarChar;
OracleParameter p3 = new OracleParameter();//dept
p3.OracleType = OracleType.Number;
p1.ParameterName = "uName";
p2.ParameterName = "uPasswd";
p3.ParameterName = "uValid";
p1.Value=pusrname;
p2.Value=pusrpass;
OracleCommand cmd = new OracleCommand(sql, con);
cmd.Parameters.Add(p1); cmd.Parameters.Add(p2); cmd.Parameters.Add(p3);
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
if(p3.value==1)
return true;
else
return false;
}
Catch(System.exception ex)
{
return false;
}
}