Getting All Instances That Are On Server
Feb 17, 2011When one 'runs' a project an instance is created. Is there a code to get all instances that are running on the server using c# ?
View 3 RepliesWhen one 'runs' a project an instance is created. Is there a code to get all instances that are running on the server using c# ?
View 3 RepliesQuoted from http://blogs.msdn.com:
User Instances (also known as RANU) available with SQL Server Express Edition, are NOT RECOMMENDED for hosting environments.I have a server running Server 2008 R2 Web Edition with IIS 7.5 and Sql Server 2008 R2 Express installed.I have only 3 friends as my hosting clients. Each has a restricted Local User Account on the server.What is the drawback of using user instance in production environment?
Edit.Rather than considering the limitation in memory usage and database size that I know, let us consider the user instance only, why isn't it recommended?
Is there an easy way to prevent users from opening multiple instances of the same web application? Can I add something to the application start section of the global page which would prevent this?
View 4 RepliesI have an asp.net website and i want to get the number of users currently viewing my site. I am aware that there are some third party softwares available, that would give me the list of the users online but i don't want to do that.Does anyone know how this can be achieved in asp.net? May be if there are any server variables that would keep a track of the website instances that gives the number of users currently visiting the site.
View 2 RepliesIn an aspx page I am calling a jquery plugin for two listboxes as below.
$(document).ready(function() {
$("select.select_AdditionalLanguages").custSelectBox();
$("select.select_Organisations").custSelectBox();
});
[code]...
Managed to solved this issue by having same class name for both the listboxes and then passing both the list box objects to the plugin
$('select.select_field').custSelectBox(null, $('#EditUsers_Organisations'), $('#EditUsers_AdditionalLanguages'));
This might not be the best solution but nothing else worked for me.
I have to preload the 9 instances of fckeditor on the page for entering the records . It is taking lot of time. the preload time can be minimized. this is the way i am doing it . They are being created dynamically
<script src="<%= Url.Content("~/Content/js/fck/fckeditor.js") %>" type="text/javascript"></script>
<%= Html.TextArea(TempData["OrganizationMeta"].ToString(), TempData["OrganizationMetaValue"].ToString(), new { @name = TempData["OrganizationMeta"] })%> [code]....
I have two instances of a usercontrol on a page. No matter which usercontrol's (uc_Addr1 or uc_Addr2 ) button I click, it always dispalys the second usercontrol's text.If I click uc_Addr1 button I need uc_Addr1 TextBox's text to be displayed. And same with uc_Addr2.
View 2 RepliesYARPQ - Yet Another Regex Pattern Question:
What I am trying to figure out is how to use a custom delimiter, single character or set of characters, to wrap a block of text inside a larger body of text and then pull that text out via regex. I have successfully done this with a single instance of wrapped text. If I have multiple instances, it blows up. Here is an example.
This would be my text block with the internally wrapped text:
[Code]....
When my current regex runs on this block, the greedy nature gives me a match starting with my first wrapped block delimeter and ending with my second wrapped block end delimeter. So my regex of @"#Delim(.*)#EndDelim" doesn't work in this instance. I am trying to figure out how to exclude the #EndDelim from my grouping. Simply using ([^#EndDelim]*) doesn't work as it tells regex to ignore the individual characters inside the brackets and not the actual word so this breaks if I have any of those characters inside my wrapped block of text.
I am probably making this harder than it needs to be. Does anyone know of a good solution or how to ignore entire words in regex?
I want to use a global data for MVC web application running on Windows Azure (e.g. something like a list of users having new messages).
For a normal webapp, I could use some per-appdomain storage like AppDomain.SetData or just static variable. What should I use for Azure instead (cache? blob storage? queues?) and what solution would be the fastest one?
I'm having problems with retrieving multiple instances of a session variable from an InProc session state. In the following code I persist a simple BusinessObject into a session variable on the Page_Load event. On the click of a button I try to retrieve the object back into 2 new declared instances of the same BusinessObject. All works great until I change one of the properties in the first instance, it changes the second instance as well. Is this normal behaviour? I would have thought as these were new instances they wouldn't demonstrate static behaviour?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
' create a new instance of a business object and set a containg variable
Dim BO As New BusinessObject
BO.SomeVariable = "test"
' persist to inproc session
Session("BO") = BO
End If
End Sub
Protected Sub btnRetrieveSessionVariable_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRetrieveSessionVariable.Click
' retrieve the session variable to a new instance of BusinessObject
Dim BO1 As New BusinessObject
If Not Session("BO") Is Nothing Then BO1 = Session("BO")
' retrieve the session variable to a new instance of BusinessObject...............................
I've been working on an usercontrol with a jquery timer in it. At first I had the jquery within the usercontrol. But when I add 2 of those controls to my page the second usercontrol isn't showing it's data very well.Now I've put the jquery into the mainpage and the usercontrol only uses the id's of the jquery.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs"
Inherits="WebUserControl" %>
<style type="text/css">
[code]...
I have a user control that I place on a page severl times. When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl. So I get duplication of an insert that I do. Is there a ay to make sure these events are isolated so this doesn't happen.
View 8 RepliesI have an ASP.NET page inside of an ASP.NET Master page, and inside the page I have two instances of the same web user control. I have given them different IDs, but when I click a button on the first user control it causes the second user control to do the expected activity and the first one does nothing. Is there something I need to do to make sure that the controls don't get confused?
View 2 Replieswhen i am trying to add a database to new website using "ADD NEW item--->SQL server databse i am getting an error which is telling
"Generating user instances in SQLSERVER is disabled.Use sp-configure user 'user instances enabled' to generate user instances."
how to enable the user instance option and where i can find it?
is there any way to stop share the static variable at multiple users....I need to create a new insatnce of static variables or not accessing the same static variables across multiple who are using the same site.....while googling i found like hisSystem.Threading.Interlocked.Increment(ref MyClass.InstanceCounter); by using can I do....or is there any other way to stop accessing the static variables accross multiple instances of my site......and in my scenario i cannot use rely on session variable also
View 2 RepliesI have a ScriptControl that uses an image as an embedded resource and GetWebResourceUrl to generate the WebResource.axd URL. I am currently using GetScriptDescriptors() to send the URL to the JavaScript object.The ScriptControl can be in a Repeater, so you may have 20+ instances. They all use the same images (not customizable through property), so I would like to set the URL once in a variable and share it. I know I could register a script block with a global variable, but would like to avoid that if possible. Is there a way to set a variable within the scope of the control type (global -> control type -> control instance)?
View 1 Repliesi am creating a MVC2 application for pubs and bars. I have a model 'Opening_Time' with the following properties:
int Day,time OpeningTimetime ClosingTimeWhen adding/editing an Opening_Time, I want to validate an Opening_Time, to check the user isn't adding one for an existing Day (ie they can't have two entries for the same day).
How/Where is the best place to do this?
Preferably, I want to do it a Model level, so I can use Model.IsValid and the Html.Form helpers
I am trying to capture instances of '&#' in a string using a regular expression.
The best validation expression I can come up with is [^&#]*
This captures &# but unfortunately also captures & and # on their own.
How do I make the expression only look for &# together?
I have the current block of code inside an OnPreRender method of a validator that is inheriting from BaseValidator. If I have one instance of the validator this works fine, but if there are multiple instances the javascript flakes out. As it stands the acutal evaluation function has to be rendered on a per instance basis. I know it's kind of a drop in the bucket, but I'd like to register the block below just once instead of giving each instance a unique key to register with.
[Code]....
If more than one person is using the web application, and the web application requires to read a specific file (and in my case, I use StreamReader), I've noticed that the any other instance of the web application would have an exception error when trying to read a file. How do you handle this? And how about when it comes to writing to the same file (if possible)?
View 5 RepliesImagine I have a class MyTestClass. And I need an instance of this Type throughout my whole web application.Now there are several possibilities to accomplish this.1. Make MyTestClass static, make it contain static methods only
Probably the most performant solution. I'm not feeling lucky about using static fields though. Thread safety? What if my static class contained a static System.Collections.Queue?
I have built a User Control in VB which displays two gridviews and allows a user to select an item in the first gridview and display multiple rows in the second grid with the key of the selected item from the first. The data to be displayed is passed to the User Control as a datatable object via a public property of the User Control.
The user control works perfectly, but to allow the the subs in the codebehind of the User Control to access the data set when the user control is initialised, I have declared them as "Private Shared".
Having got everything to work, I now want to display multiple instances of the same User Control with different datasets.
However, because my data objects are defined as "Private Shared" each instance of the user control is overwriting the data of the others.
I can fix this problem by removing the "Shared" keyword, and have also tried setting them to "Protected" instead but then my variables expire after being set and contain "Nothing" when I get to the "RowCommand" event in the Code Behind.
I'm sure I must be doing something stupid, because surely the whole idea of User Controls is to make reusable code drven by parameters.
Here is my code:
Main Program .aspx
[Code]....
Main Program Code Behind
[Code]....
User Control .ascx
[Code]....
User Control Code Behind
[Code]....
It seems when I try to dynamically create multiple instances of a User Control, I get an Object Reference Not Set To An Instance Of An Object error on any ASP control that I'm using in that User Control
Here's the class where I'm creating them.
[Code]....
Am I able to successfully refer to a panel on the page that I'm calling this routine from simply by ByVal ... As Panel, or should I use HttpContext?
I'm having trouble loading (several) multiple instances of crystal's ReportDocuments in memory. Using the following code:
Dim sRPT As New ReportDocument
sRPT.Load("PATHTOMY.RPT")
Dim sRPTs As New List(Of ReportDocument)
For i = 0 To 100
Dim sClone As ReportDocument = sRPT.Clone
sClone.Refresh()
sRPTs.Add(sClone)
Console.WriteLine("RPT Clonado " & i.ToString())
Next
when I reach the 74th instance, the Refresh() call throws a "Report Load failed" exception. Furthermore, the same exception happens even directly calling the .Load(path) method, and affects all ReportDocumetns within the application, regardless the RPT file I'm loading/refreshing.
I'm currently using Crystal XI R2, but testing this code with the v12 assemblies (CR 2008) ended with the same problem. Has anyone ever stumbled with something like this? The reason for all this instances is a report caching for multiple rpt files, per user, and will most likely stay as it is if there is a not-so-nasty workaround for this problema.
i have this problem where Microsoft actually got the month names wrong for the Greenlandic culture (kl-GL). I also know that i can pass my own array of string to the DateTimeFormatInfo.MonthNames Property, but it seems like the values i specify is only used in the scope of that one CultureInfo instance. Is there a way to tell .Net that every time i have an instance of the kl-GL culture these specific monthnames should be used?
I know that you can create user specific cultures, but i don't have access to some legacy code to actually change the code to use a my own userspecified culture.