Excellent and daily use code grocerry shop for ASP.NET 2.0....
http://www.asp.net/QuickStart/aspnet/default.aspx
Happy Programming!!
Tuesday, January 31, 2006
Wednesday, January 25, 2006
Thursday, January 19, 2006
Performance Considerations for Run-Time Technologies in the .NET Framework
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftechs.asp
Performance Tips and Tricks in .NET Applications
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftips.asp
Rescue to all kind of Debugging in .NET !!
http://www.gotdotnet.com/team/csharp/learn/whitepapers/howtosolvedebuggerproblems.doc
Wednesday, January 18, 2006
Top Intv Ques: Nth Highest Salary of Emp !!
I m always having trouble to build this query but now i got it forever!!!
Say "Emp" table structure is:
EmpID Salary
1 100
2 500
3 200
4 400
Say we have to find 2nd highly paid employee...Here we go.....::
select Salary from Emp A where 1 = (select count(Salary) from Employee B where B.Salary > A.Salary)
Note: "1" in above query is Nth Max - 1 or in other words if we have to find say 3rd highest see how many are there above three ?? Obviously two sp put 2 na intead of 1....(here we are looking for 2nd highest thats why i have put 1...Samje...)
Simple and Perfect....Kya baat hai!!! Wah Wah....
Say "Emp" table structure is:
EmpID Salary
1 100
2 500
3 200
4 400
Say we have to find 2nd highly paid employee...Here we go.....::
select Salary from Emp A where 1 = (select count(Salary) from Employee B where B.Salary > A.Salary)
Note: "1" in above query is Nth Max - 1 or in other words if we have to find say 3rd highest see how many are there above three ?? Obviously two sp put 2 na intead of 1....(here we are looking for 2nd highest thats why i have put 1...Samje...)
Simple and Perfect....Kya baat hai!!! Wah Wah....
Friday, January 13, 2006
Excellent E-Books
Here i got good collection of e-books....
http://www.maththinking.com/boat/booksIndex.html
http://www.maththinking.com/boat/booksIndex.html
Sunday, November 27, 2005
Thursday, November 24, 2005
Friday, November 18, 2005
ASP.NET Questions
1) How security is implemented in asp.net
ASP.NET implement security in three ways
a- Forms-based security
in this case you set the IIS authentication system to anonymous access to enable the ASP.NET to validate authentication itself by checking if the user name & Password is equivalent to the same info which is stored anyhow (XML, Database, ...)
b- Windows-based security
according to this option any user access the site must have a registered windows account and a dedicated permissions
Passport-based security
this is a centric authentication service in which one login could auto authenticate the user for many sites where is no need to store the user names & passwords into each site
all what you have to do is to creat a folder then move your required files into it then configur the web.config as follows :
// or you can write your pages names instead of folder name
it is the auto generated default view of the table in the dataset , when dealing with any table in a dataset, .NET makes a view of that table to can communicate with it so it is the default one
they all do the same functions except the stored functions can return a table and can be implemented into a select statement like " select myFunction(someParam)"
You can use session variables to store this a.aspx textBoxs Like session ["myVar"]=TextBox1.Txt
the datagrid is designed to show a table-like data to the user but the datalist is designed to show a row-like data
ASP.NET implement security in three ways
a- Forms-based security
in this case you set the IIS authentication system to anonymous access to enable the ASP.NET to validate authentication itself by checking if the user name & Password is equivalent to the same info which is stored anyhow (XML, Database, ...)
b- Windows-based security
according to this option any user access the site must have a registered windows account and a dedicated permissions
Passport-based security
this is a centric authentication service in which one login could auto authenticate the user for many sites where is no need to store the user names & passwords into each site
2) In my website for eg. it has around 100 aspx. In that I want 20 aspx files should be available to the users only if they are logged in. How can I achieve this with web.config file.
all what you have to do is to creat a folder then move your required files into it then configur the web.config as follows :
What do you meant by default view
it is the auto generated default view of the table in the dataset , when dealing with any table in a dataset, .NET makes a view of that table to can communicate with it so it is the default one
Difference between stored procedure and stored functions
they all do the same functions except the stored functions can return a table and can be implemented into a select statement like " select myFunction(someParam)"
5) I have a file called a.aspx which has some textboxes. I want to post the values to b.aspx without using response.redirect. How can I do this.
You can use session variables to store this a.aspx textBoxs Like session ["myVar"]=TextBox1.Txt
Different between datagrid and datalist
the datagrid is designed to show a table-like data to the user but the datalist is designed to show a row-like data
Monday, November 14, 2005
Improving Web Service Performance : CheckList
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetcheck09.asp
All about Installers - Customizing Windows and Web setup projects
http://www.codeproject.com/dotnet/CustomizingInstallers.asp
Wednesday, October 05, 2005
String Vs String Builder
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/vbnstrcatn.asp
Tuesday, September 20, 2005
Microsoft .NET Framework FAQ
FAQ's on .NET Framework from Microsoft !!
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dndotnet/html/faq111700.asp
Keep watching this blog !!!
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dndotnet/html/faq111700.asp
Keep watching this blog !!!
Monday, July 18, 2005
String.Contains + Some Other String Improvements in VS2005
There's some things just so glaringly obvious, so innately presupposed that you just assume it's there and it's an impossible task to convince your brain otherwise.
For me, this is string.Contains. For years I've typed "name.Conta…" only to stop and realize that it's not there. I begrudgingly type in "name.IndexOf("sdfsd")>-1" instead. The next time I do the same. In fact I've been using .Net since it was in early beta and yet I still haven't come to terms with the fact string.Contains is missing.
Then today, working in VS 2005, I once again accidentally type it in - and to my disbelief it's actually there! Very cool.
Couple of other things I noticed:
1. String.Split now accepts strings. That means you can split a string like “bob and harry and mary and jane“ on “and“ and you'll get just the people names.
2. String.NullOrEmpty is a new static method that returns true if the string is null or empty (““). All those times I've used code like “if (name==null || name==““) “...
That's what I call progress.
For me, this is string.Contains. For years I've typed "name.Conta…" only to stop and realize that it's not there. I begrudgingly type in "name.IndexOf("sdfsd")>-1" instead. The next time I do the same. In fact I've been using .Net since it was in early beta and yet I still haven't come to terms with the fact string.Contains is missing.
Then today, working in VS 2005, I once again accidentally type it in - and to my disbelief it's actually there! Very cool.
Couple of other things I noticed:
1. String.Split now accepts strings. That means you can split a string like “bob and harry and mary and jane“ on “and“ and you'll get just the people names.
2. String.NullOrEmpty is a new static method that returns true if the string is null or empty (““). All those times I've used code like “if (name==null || name==““) “...
That's what I call progress.
C# source code line counter and a .net complexity analyzer (using the cyclomatic complexity index !!
http://dotnetjunkies.com/WebLog/johnwood/archive/2005/01/16/44995.aspx
Friday, July 08, 2005
Difference b/w ADO and ADO.NET
Differences Between ADO and ADO.NET
ADO and ADO.NET have various differences, such as differences in architecture, data representation, and methods of sharing data between applications.
In-Memory Representations of Data
ADO uses a recordset to represent data that is retrieved from tables in memory, whereas ADO.NET uses DataSets. A recordset usually contains data from a single table. To store data from multiple tables, you use a JOIN query. The JOIN query retrieves the data from multiple tables as a single result table. Alternatively, ADO.NET uses a DataSet to represent data in memory. As mentioned earlier, a DataSet can store data from multiple tables and multiple sources. In addition, a DataSet can also contain relationships between tables and the constraints on a table. Therefore, a DataSet can represent the structure of a database.
ADO provides a read-only navigation on recordsets, which allows you to navigate sequentially through the rows of the recordset. However, in ADO.NET, rows are represented as collections. Therefore, you can access records using the primary key index. In addition, you can also filter and sort results.
Minimized Open Connections
In ADO.NET, you only connect to a database to retrieve and update records. You can retrieve records from a database, copy them into a DataSet, and then disconnect from the database. Although a recordset can provide disconnected data access in ADO, ADO was primarily designed for connected scenarios.
In ADO.NET, you communicate with the database using a DataAdapter or a DataReader that makes calls to an OLE DB provider or to the APIs provided by the data source.
Sharing Data Between Applications
You use COM marshaling in ADO to transfer a disconnected recordset from one component to another. In ADO.NET, you transfer a DataSet using an XML stream. XML provides the following advantages over COM marshaling when transferring data:
Richer data types.
COM marshaling can only convert data types that are defined by the COM standard. In an XML-based data transfer, restrictions on data types do not exist. You can use XML-based data transfer to transfer any data that is serializable.
Bypassing firewalls.
A firewall does not allow system-level requests, such as COM marshaling. Therefore, a recordset cannot bypass a firewall. However, because firewalls allow HTML text to pass and ADO.NET uses XML to transfer DataSets, you can send an ADO.NET DataSet through a firewall.
ADO and ADO.NET have various differences, such as differences in architecture, data representation, and methods of sharing data between applications.
In-Memory Representations of Data
ADO uses a recordset to represent data that is retrieved from tables in memory, whereas ADO.NET uses DataSets. A recordset usually contains data from a single table. To store data from multiple tables, you use a JOIN query. The JOIN query retrieves the data from multiple tables as a single result table. Alternatively, ADO.NET uses a DataSet to represent data in memory. As mentioned earlier, a DataSet can store data from multiple tables and multiple sources. In addition, a DataSet can also contain relationships between tables and the constraints on a table. Therefore, a DataSet can represent the structure of a database.
ADO provides a read-only navigation on recordsets, which allows you to navigate sequentially through the rows of the recordset. However, in ADO.NET, rows are represented as collections. Therefore, you can access records using the primary key index. In addition, you can also filter and sort results.
Minimized Open Connections
In ADO.NET, you only connect to a database to retrieve and update records. You can retrieve records from a database, copy them into a DataSet, and then disconnect from the database. Although a recordset can provide disconnected data access in ADO, ADO was primarily designed for connected scenarios.
In ADO.NET, you communicate with the database using a DataAdapter or a DataReader that makes calls to an OLE DB provider or to the APIs provided by the data source.
Sharing Data Between Applications
You use COM marshaling in ADO to transfer a disconnected recordset from one component to another. In ADO.NET, you transfer a DataSet using an XML stream. XML provides the following advantages over COM marshaling when transferring data:
Richer data types.
COM marshaling can only convert data types that are defined by the COM standard. In an XML-based data transfer, restrictions on data types do not exist. You can use XML-based data transfer to transfer any data that is serializable.
Bypassing firewalls.
A firewall does not allow system-level requests, such as COM marshaling. Therefore, a recordset cannot bypass a firewall. However, because firewalls allow HTML text to pass and ADO.NET uses XML to transfer DataSets, you can send an ADO.NET DataSet through a firewall.
Subscribe to:
Comments (Atom)