Saturday, June 27, 2009
Adding, assigning and Editing the values of a data set... (.net 2.0 + )
First of all you have to get a object of data column class and add your type on that class and their column name.
DataColumn dcMaxAlwdAmt = new DataColumn("MAX_ALWD_AMT", System.Type.GetType("System.Double"));
double _MaxAllowedAmtPerSch = 1000;
Then add the column in data set.
dsTranSchems.Tables[0].Columns.Add(dcMaxAlwdAmt);
Now the no is to assign the defined value at the defined position of data set....
foreach (DataRow dr in dsTranSchems.Tables[0].Rows)
{
dsTranSchems.Tables[0].Rows[_rowCount]["MAX_ALWD_AMT"] = _MaxAllowedAmtPerSch;
_rowCount = _rowCount + 1;
}
This way you can add the value by adding column and data set and add the value too.
Now i am working over Typed DataSet. Will do this soon.
Happy reading ............. Cheers Neeraj Triparthi.
Monday, June 22, 2009
Executing procedure of oracle with out parameter
This is the problem, over which i was struggling at last night. I have one oracle procedure which have two parameter on in type another of out type.
See, although we used to execute procedure like
SQL > exec proc_name(par1, par2);
But this idea failed when u have a out type parameter. So for that On SQL+ then first of all declare a variable like this
STEP 1 :
SQL> set serveroutput on;
SQL> var vartemp varchar2(150);
STEP 2 : then execute in the manner
SQL> exec MP_PROPOSAL_CODEGEN('20000585',:vartemp);
PL/SQL procedure successfully completed.
STEP 3 : And the go for the value of vaiable as
SQL> print s;
S
--------------------------------------------------------------------------------
20000585/2/062009
That is the output.
Although this is not a tough task but it's tricky. So let’s again in search of some new and good codes.
Happy coding ... Cheers Neeraj
Wednesday, May 20, 2009
Calling JavaScript on Asp.Net Code behind Page in a Ajax Enabled Site. (VS 2005 + .Net 2.0)
Monday, May 4, 2009
Implementing Ajax in VS 2003 ( .NET 1.1) by objXmlHttp java scrpit object
Tuesday, September 30, 2008
Best Practices, Create Web gardens : Enhancing performance( IIS 6.0 Web API )
By Implementing the "Web Garden", we can improve availability of web application and web services, by increasing the number of worker process servicing the application pool. The idea behind configuring an application pool to use multiple worker processes (i.e a Web Garden) is to improve scalability and reliability, as these worker processes are all competing for the same CPU time.
- Reduced resource contention : At reaching the study state of web garden, according to round robin method, every new TCP/IP connection is assigned to a worker process of web garden.
- Determined request processing : For request of application pool, other hunger worker processes accepts and process the request, at the time when a worker process of application pool is stop resounding.
- The Performance must be greater for synchronous API's.In a case if application calls a database slow responding Data Base , Then without waiting for the slow database connection to complete, Web garden supports other concurrent connections.
- There must be the multi-instantiated application running on, mean to different instance assigned to each worker process.
- Sever CPU must be best performer, mean it never be Bottleneck.
- Control Panel -> Administrative Tool -> Open IIS
- Right click on the Application pool. (If exits other wise create and attach the application with pool.)
- Go to properties -> Performance Tab - At Bottom.
- See -> Maximum no. of worker process (default value 1).
- -> Increase as required > 1.
Wednesday, August 20, 2008
Page Directive Attribute AutoEventWireup : Simple Rule and Safest Guiding
Over looking widely, we can handle this attribute with following location --
1) At the Tag of .aspx page (For local to page only)
“%@ Page Language="C#" AutoEventWireup="true" CodeFile="AutoEvent.aspx.cs" Inherits=" AutoEvent" %”
2) By the Configuration File “web.config” (Local For An application)
"configuration""system.web""pages autoEventWireup="truefalse" /"
"/system.web""configuration"
3) For Machine with Machine Configuration File “Machine.config”
"configuration""system.web""pages autoEventWireup="truefalse" /" "/system.web""configuration"
(For An application related to machine)
4) In web usercontrol (on .ascx file)
Have a look on working style –
For VS 2005
Now for a new asp.net page by default AutoEventWirup is true, and in .aspx.cs file
The page framework calls page events automatically, specifically Page_Load and Page_Init methods.
Let a experience : We have to methods respectively
1) protected void Page_Load(object sender, EventArgs e){ }
2) protected void Button1_Click(object sender, EventArgs e) { }
When AutoEventWireup="true"
Then for every required request( Click / Refresh) of the page framework
Debuge both the 1), 2) methods. Becouse framework automatically calls the page event.
When AutoEventWireup="false"
Now see, for every required request( Click / Refresh) of the page framework Debuge only 2) methods. Becouse framework don’t calls the page event.
Now surprisengly I chip more view here as If we create the method in .aspx page as
and AutoEventWireup="true" then framework debuge only .aspx Page_Load because it hids the inharited page_load member (of .aspx.cs file).
"script runat="server" language="C#" "
protected void Page_Load(object sender, EventArgs e) { }
"/script"
I observed the signs of impending doom; I felt things where as idyllic as they appeared on the surface.
For VS 2003
In this version of .NET default AutoEventWireup="false" and now it works diffrently Here event handlers are automatically created, find this in initialize component
this.Load += new System.EventHandler(this.Page_Load);
Now If AutoEventWireup="false" and you commented the this.Load += new System.EventHandler(this.Page_Load); Then
private void Page_Load(object sender, System.EventArgs e) {}
is never calls the page event methods.
But If in this condition you set AutoEventWireup="true" then
private void Page_Load(object sender, System.EventArgs e) {}
must be called by framework. Because ASP.NET Runtime dose not require event specify event handlers, framework must make a call to CreateDelegate method for form .
And this way it happens, the massive brilliant logic having instructions as Mother of all events of a page. This is what I do and light on.
Thanks
Let again in search of …..
Cheers ….! Neeraj Tripathi.
Monday, August 18, 2008
Few words before Any More....
There's a star to guiding the humble--
Trust in "God" and do the right.
I express special thanks :
- To readers of my blog and my friends. Who graciously took the time to read to me and share their views for me.
- To Dear Shekhar Sir for your endless support and love. You are why i do what i do. I deeply value your guidance.
- To Pankaj k Shukla for light that shows me the way and for believing in me and for making things happen.
- And in all the way thanks to my dear seniors and colleague for wining support and action.
This is what i want to do from very first morning of my academic years, to write something for what you are witness of and whatever I can do for this humble nature and world.
Lets again in search of.....
Cheers....! Neeraj Tripathi
