By default each application pool in IIS 6.0 (hosted in windows 2003) is supposed to run in one worker process (w3wp.exe). Unless you activate web gardening to serve your application by multiple worker processes, there is only one and one process serving all the requests to one application pool.Well, you may ask that if there is only one process then what is the boundary between all these applications in the same application pool? (Good question!!)
Although the code for all applications resides inside one process, the unit of isolation is the .NET AppDomain..Net Application domain acts exactly like a process in OS and is both a container and a boundary. If there are classes with shared or static members, each AppDomain will have its own copy of the static fields – the data is not shared. The code and data for each application is safely isolated and inside of a boundary provided by the AppDomain. The main way to communicate between AppDomains (like any other Cross-Boundary scenarios) is to use .NET remoting.
If you look at msdn , you’ll see that AppDomain Class inherits MarshalByRefObject which makes it accessible across application domain boundaries through the use of remoting.However there is a security caveat to the concept of using AppDomain as a boundary which is the fact that each ASP.NET application is run with full trust by default and if hosted by AppDomain, then security threat becomes more serious as AppDomian is not really a secure boundary and it is hosting a full trust code as well ,so a native code can be injected into it and get an access to all unmanaged resources.
Categories: Uncategorized Tags:
If you are planning to create a web part that can retrieve and display a thumbnail of a random image from the picture library, then you have two options:
1) The images are stored as binary fields in the DOCS table inside the _SITE database. The field name is CONTENT. Simply connect to the database to retrieve the image. This is not the way I usually get stuff done in SPS.
2) I would suggest you access the images via the Sharepoint namespaces. Picture libraries store their image files in the same manner as document libraries store documents, so get a reference to the picture library as an SPList class and retrieve the image from the SPListItem.File property.
protected override void RenderWebPart(HtmlTextWriter output)
{
string url;
string caption;
string HTMLtext;
try
{
SPWeb mysite=SPControl.GetContextWeb(Context);
SPListCollection lists=mysite.Lists;
foreach (SPList list in lists)
{
if (list.Title.Equals(PicLib.ToString()))
{
SPListItemCollection items=list.Items;
int rndCount=items.Count;
if (rndCount > 0)
{
int intRandom=rIndex.Next(1,rndCount);
url= items[intRandom].File.Url;
caption=items[intRandom].File.Title;
HTMLtext= “some html text”;
output.Write(HTMLtext);
}
else
{
output.Write(“There is no picture in the selected picture library.”);
}
}
}
}
catch(Exception e)
{
output.Write(SPEncode.HtmlEncode(e.Message.ToString()));
}
}
Categories: Uncategorized Tags:
“There are so many SQL server database and structure comparison tools; may I know which one is better?”. Well this is one of the most frequent questions, asked in SQL Server communities,therefore I decided to clarify this based on my experience and the products I’ve used so far.
I mainly use Red Gate SQL Bundle developer edition for all DB related tasks and mostly for keeping my DBs in sync as I move up from dev to test to pre-prod and finally production, that’s why I prefer Red Gate myself. Doesn’t mean it’s “better”, I think that’s a personal subjective thing, but there are two more possibilities that I’m aware of:
1) Apex
2) DB Ghost
When I first used Apex SQL Edit, I was under the impression that their products are NOT as polished as they should be; it hangs a lot when it comes to huge databases and it hugs the resources a lot, so for the sake of this article, I took their products out of my benchmarking task. I’ve mucked around with DB Ghost a lot recently and I have found it to be extremely reliable and it provides additional capability beyond comparison e.g. a rock-solid process to upgrade your databases (same as Red Gate),but still believe that from a developer’s perspective Red-Gate dose a better job than all its competitors. Below is only a feature comparison on Red-Gate and DB Ghost’s most popular product.
SQL Bundle Developer Edition (Red-Gate):
SQL Compare and Synchronization:Yes
SQL Data Compare:Yes
DTS Compare: Yes (That’s really handy if you are using DTS as an ETL tool)
Build Database from Script:Yes
Scripter:Yes
Extra:SQL Toolkit (APIs and command line tools to programmatically compare database objects are all exposed to the clients)
Price: http://www.red-gate.com/dynamic/shoppingcart/QuoteProductOption.aspx?Product=SQLBundleDeveloper
DB Ghost Professional Edition™
SQL Compare and Synchronization: Yes
SQL Data Compare:Yes
DTS Compare:No
Build Database from Script:Yes
Scripter:Yes
Extra:Nothing
Price:http://www.innovartis.co.uk/database_solution_Purchase.aspx
Categories: Uncategorized Tags:
Recently I’ve came across another strange issue with reporting serivces.I’m hopping that all these stuff are well addressed in Yukon version ,or else 🙂 .I didn’t make the database case sensitive collation in the setup and case sensitive collation was not also activated in any of the columns throughout the database. In one of my tables, there is a column called “Client_Type” which is of type Varchar and unfortunately there are some bad data sitting there (might be because of wrong UI validations or data conversion or whatever).Below is different chunks of data in that column.
PRIMARY
PRIMARY MAKER
SECONDARY
Primary
Primary Maker
Secondary
From database standpoint, there is no difference between “Primary” and “PRIMARY” (which is obvious as I didn’t activate “case sensitive collation”),but when it comes to Reporting services it DOSE matter!! specifically in formulas and string manipulation functions. How come it is case sensitive in reporting services whilst is not in its backend database ?!!!
There is a possible workaround for this. Add ToString().ToUpper() to all field values used in comparisons. Of course changing the collation of the database is another possibility,but Just for your reference, specifying collation is usually done for the whole server in the installation of sql server and changing one database collation afterward is a bit tricky ,because if you have one database on a server which has a different collation to the server default, it will also have a different collation to TEMPDB. This can cause unexpected problems with sorting of results, and handling of #temp table data. Better, if you can, to get the whole server at the right collation.
Categories: Uncategorized Tags:
Let’s assume that you are going to interview someone for a supervision position. Like any other tasks, you have to define a strategy in advance to manage a successful interview and to achieve what you want to get the most out of that particular person for whom you have arranged the interview. Here are some questions /suggestions that I’m aware of.Just go ahead and pick the ones which best suit your case. They are a bit tricky, so you may want to ask them in a way that he doesn’t think you are trying to make him look silly or bringing him down. Nodding your head to signal approval and smiling are very effective ways to get him in the mood and to get him breathless with your level of professionalism as well.
The first important thing to be considered is that instead of asking direct questions like what is your favorite…? Or how do like ……? ; try to ask scenario-based questions. For instance throw him one of your everyday hassles or challenges at work and then ask him what his plan is to approach or probably solve it. This also implies that you know your business bottom lines. Well, these scenarios should not be very difficult to be contextualized or realized .People normally start with very simple ones and make it harder as they go deeper.
Now, let’s have a look at the questions:
Scenario-based questions:
1)what have you done to prepare yourself to be a supervisor? >>I personally like this one!! It reveals a lot.
2)We don’t have a facility to do bluh bluh bluh (archiving the tickets or recording the feature requests or etc)? Can you think about a solution?
3)There is a customer on the line complaining about one of us. Could you please walk me through, exactly what you usually do in these circumstances?
4)How do you manage client’s requests with your team’s ability and availability? How do you reprioritize the tasks?
General questions:
1)What aspect of supervision do you find the most difficult?
2)How do you decide what to delegate and to whom?
3)In what kind of work environment are you most comfortable?
4)What is the most important quality a supervisor should have?
The last and the most important thing to remember is that if you feel that he is not an able person; don’t make him awkward by asking difficult questions. It is not fare.
Happy interviewing and good luck!
Categories: Uncategorized Tags: