|
Another point to add.
Your original method, initializing the member field to a valid value when accessed, is a technique called "lazy initialization" and is good for initializing objects that may have a heavy penalty such as in time or memory usage. For example, if your object contains a large collection that is not used in say 50% of the cases, you can put off initialization until it is needed. Or if that collection may take time to initialze, may be populated from a database, you can put it off until after the object has been created.
only two letters away from being an asset
|
|
|
|
|
Hi,
I have got a public key token, and want to remove/unregister all assemblies from GAC having that public key token, does any one know about it?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language, so please don't mind if i do some grammatical or spelling mistakes in my messages."
|
|
|
|
|
Hi,
I don't know easy solution, because Gacutil can't uninstall assembly by PublickKeyToken (or may be I don't know how to do this). I think you can prepare script (on Python, for example), which will start 'gacutil /l' command and take list of all assemblies in GAC. After that you can parse these results, because they contain Assembly name and Public key token, and take list assemblies' names. You can use this list to call 'gacutil /u' for removing of all these assemblies.
|
|
|
|
|
hi frnds,
i am using OS win2k with sp4 and installed Visual studio 2005 successfully. My system is under BLAHBLAH domain if i login with the domain name then my dotNet is hang at the Initializing Toolbox and End to not responding,
but
if i am login with the local admin then it will run well N good,
to trap this error i have format my system and reinstall each and everything
then also same problem continue,
Please help...Is there any setting in WIN 2k to run the .net under domain ????
where i am wrong...????
this condition not happened with XP.
Is it my RAM problem...????
THANKX IN ADVANCE
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
.Net framework will work perfectly in the higher version of windows 2003 and above.
If you want to work on the .Net Framework please install Vista or XP that will be be safe.
And also check the RAM if you have 1gb Min it will be good.
Regards,
Satips.
|
|
|
|
|
Satips wrote:
If you want to work on the .Net Framework please install Vista or XP that will be be safe.
Works just fine on my Windows 2000 guinea pig box with 256mb ram, .net 2.0 and sql 2005.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
quite Interessting.
only 256mb ram. if you should have installed the Proffessional edition of Asp.Net2.0 the Minimum requirement is 512 mb or above.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Yep. Running .NET 2.0 and no problems with it, knock on wood
"That's no moon, it's a space station." - Obi-wan Kenobi
|
|
|
|
|
hi i read this website on getting read/writing to excel 2007 coding
http://msdn2.microsoft.com/en-us/library/bb332058.aspx[^]
this step "select Insert Snippet, and select the Excel: Get cell value snippet from the list of available Office 2007 snippets."
i cant seem to get it to work when i insert snippet i dont get the excel tab anyone know y?
|
|
|
|
|
There are no Excel snippets in the ones that come with VS, I'd say they are part of the Visual Studio tools for office.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
Is it possible to make a reference to an appliaction that is already running
and then take control of this application in .Net ?
I was looking today at the SHDocVw.dll (internet explorer) which provides a class
that when initalised represents a collection of all the running IE instances. You
can then iterate through the collection to find the instance you want, set
an IE object equal to it and then programatically control the window.
I'm wondering now if there's a more general class that can represent all running applications.
I looked at System.Diagnostics.Process.CreateObjRef() but.....
Thank for reading
|
|
|
|
|
You can get the processes running by using
Process.GetProcesses
So you could code
For each item as process in process.getprocesses
'Do something
next
|
|
|
|
|
Hi everyone,
i need a little help. So im trying to creat an exception policy with logging without using *.config file. Im using all the classes i need like : TraceListener, TextFormatterData, EmailTraceListenerData etc., but my problem is that i dont know the steps(the algorithm) for creating a policy without the *.config file? Can somebody help me?
Thank you in advance!
|
|
|
|
|
System.Diagnostics.Debug.Listeners.Add(listener);
System.Diagnostics.Trace.Listeners.Add(listener);
|
|
|
|
|
To originSH : Thanks but i cant find the place for this code. If you dont mind see what i already wrote :
catch (SqlException ex)
{
TextFormatterData emailTextFormatterData = new TextFormatterData();
emailTextFormatterData.Name = "Text Formatter";
emailTextFormatterData.Template = "<template>
|
|
|
|
|
Does anyone know if it is possible to call a web service to return some data and after the data has been returned the web service carreis one fetching more data. So it starts a new thread that carries on after the call has been completed?
I am trying to write a web service to retrieve data from the database that can return the first page only on large data sets and then fetch the rest into cache after the call, so any subsequent pages will be fetch quickly.
|
|
|
|
|
Hi,
I have C# GUI that use managed C++ dll. the managed c++ dll calls unmanaged c++ dll. The three projects compile and link correctly.
but I have the following run time exception:
"The specified module could not be found"
Somewhat, the unmanged C++ dll could not be read. Any idea why I have such error?
Thank you.
Alam
|
|
|
|
|
Perhaps your program can't find the unmanaged dll.
|
|
|
|
|
I have a set of class all deriving from the same interface, iVendor. Now I have a user control that I am formatting according to the type of VendorClass that it will be assigned via a property. The problem is the following: My middle tier is returning a generic Collection that is returned from a generic function. So my function signature is as follows:
public static Collection<t> GetVendors<t>(eDataDetail eDetail, int Contract_ID, ref ContractsException oCEExecption,
int startRowIndex, int maximumRows, out int TotalRowCount) where T : iVendor, new()
I'm trying to assign the result of this function call to a property on my usercontrol with a signature of :
public List<ivendor> Vendors
{
get { return this._oLVendors; }set { this._oLVendors = value; }
}
I'm trying to make the assignment as follows:
ctlDemographics.Vendors = new List<ivendor>(Contract.GetVendors<contractvendor>(Contract.eDataDetail.Basic, this.ContractID, ref oCE, 1, 300, out TotRowCount));
SInce there is no such thing as Generic properties can someone explain how I would go about handling this?
Thanks
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
Hi Santiago,
You could do this;
class MyClass<t>
{
private List<T> _list = null;
public List<T> Prop1
{
get { return _list; }
set {_list = value; }
}
or if you have a known base class or interface of the types to be stored on the List
you can do this:
public interface iInterface{}
class MyClassA:iInterface{}
class MyClassB:MyClassA{}
class MyClassC:MyClassB{}
class MyClassD
{
private List<iInterface> _list = null;
public List<iInterface> Prop1
{
get { return _list; }
set {_list = value; }
}
Andy
|
|
|
|
|
Using your example I have :
using SCG = System.Collections.Generic;
SCG.List oColl = new SCG.List();
oColl.Add(new B("Michelle"));
oColl.Add(new B("Chris"));
oColl.Add(new B("kathy"));
this.Prop = new SCG.List<iclass>(oColl);
public SCG.List<iclass> Prop
{
get { return new SCG.List<iclass>(); }
set { }
}
I get an error on line:
this.Prop = new SCG.List<iclass>(oColl);
Error is:
Error 1 The best overloaded method match for 'System.Collections.Generic.List<webapplication1.iclass>.List(int)' has some invalid arguments C:\Projects\ConsoleApplication1\WebApplication1\Default.aspx.cs 26 25 WebApplication1
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
This error could be because of a type mismatch - but since the type used for list is not given in your examples it's impossible to tell.
Andy
|
|
|
|
|
I think I found the solution: COnvertAll method of the COllectionBase Collections.
//Collection to list
SCG.List oColl = new SCG.List();
oColl.Add(new B("Michelle"));
oColl.Add(new B("Chris"));
oColl.Add(new B("kathy"));
SCG.List<iclass> ListA = oColl.ConvertAll<iclass>(new Converter<b,iclass>(ConverttoIClass));
public static iClass ConverttoIClass(iClass obj)
{
return (obj as iClass);
}
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
FOund the solution using PowerCollections Algorithms class:
ctlDemographics.Vendors = new List<ivendor>(Algorithms.Convert<contractvendor, ivendor="">(Contract.GetVendors<contractvendor>(Contract.eDataDetail.Basic, this.ContractID, ref oCE, 1, 300, out TotRowCount), Vendor.ConverttoiVendor));
Had to create a Convert Delegate, very simply:
public static iVendor ConverttoiVendor(iVendor oV)
{
return (oV as iVendor);
}
THen just pass that to the constructor of a new generic List<>.
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
Hi All,
I am sure this has been answered somewhere, but I have scoured the web for a couple hours and seem to find the question being asked but never answered. My problem is simply this:
I have an LDAP query that simply pulls the groups out of Active Directory and adds them to listbox. The application works perfectly on my development box; however, when I take the application live as a website on a development server instead of groups being returned and added it only adds 1 line to the listbox, "System.byte[].
Here is what my code looks like, pretty basic directory searcher:
private void PullGroups(string DistinguishedName)
{
DirectorySearcher ds = new DirectorySearcher("mycompany's domain");
ds.PageSize = 0;
ds.SearchScope = SearchScope.Subtree;
ds.ReferralChasing = ReferralChasingOption.None;
ds.SizeLimit = 100000;
ds.Filter = "(&(objectClass=Group)(objectCategory=Group)(ManagedBy=" + DistginuishedName + "))";
SearchResultCollection src = ds.FindAll();
try
{
foreach (SearchResult searchResult in src)
{
string groupName = searchResult.Properties["sAMAccountName"][0].ToString();
lstGroups.Items.Add(groupName);
}
}
catch
{
}
}
Any help on this would be greatly appreciated. Thanks, Matt
|
|
|
|