Hi I think that you are searching for the Assembly.Load method that load an assembly for dynamic invocation.
Nissim Salomon
Posts
-
dll loading? -
How to set an item in a object's property(of array type) using ReflectionHi Before you can set the SomeFieldinAccount1Class property/field value you need to intialize / create the element at position 0
objTempType.P1[0] = new Account1();
-
hard disk serial noHi Try the following link that discribe exacly what you want How to Retrieve the REAL Hard Drive Serial Number[^]
-
Linq on Collection of ObjectsHi Try the Hands on lab of the C# 3.0 at the following link http://www.google.co.il/search?hl=iw&q=hands+on+lab+c%23&meta=&aq=f&oq=[^]
-
Trouble installing Windows Service on different computerHi I suggest to install the service manually in order to understand if the problem cause by the installation program
-
How can i??Hi when you create a class that inherit from another class you must specify the base class type, this is the solution for your question.
class Base { public Base() { } } class Derieved : Base { public string GetPerentName() { return typeof(Base).Name; } public Base GetPerentObject() { return (Base)this; } }
-
The "Create GUID" tool is disable in my Visual Studio 2005 IDE.Hi Download it form the following link http://www.microsoft.com/downloads/details.aspx?familyid=94551f58-484f-4a8c-bb39-adb270833afc&displaylang=en[^]
-
Read specific lines from txt file and write them to another fileWhile you are writing a line to the output file manage a counter that will be the limit size of the output file when the counter as reach the limit close the stream and open a new for a new file
-
[Message Deleted]Hi try the following: http://www.pluralsight.com/community/blogs/dbox/archive/2005/07/18/13377.aspx[^]
-
Read specific lines from txt file and write them to another fileHi Why not writing the line to the new file ?? at the moment you decide to keep this line. The array is not a very good solution because you need to parse the stream again in order to go back and forward. (you need to keep the postion of the stream not the line No) I think a good solution to your problem can be: 1.open the file 2.read line 3.if the line is to be saved -> process the line (if you need) 4.save the line in the output text file 5.read the next line.
-
basic questions about enum1.you are right the all purpose of enum is to give you the ability to use some logical const names insetd of numbers for example enum Days { Sat = 1, Sun, Mon, Tue, Wed, Thu, Fri } vs 1,2,3,4,5,6,7 there for it is not wise to override the enum consts using numbers if the enum was declared use it, specially if you need to cast it in order to use numbers. 2.Please read the "using flags attribute" in the msdn article.
-
XMLSerializer1.The XML Serializer creates an XML serialization assembly per type that you are trying to Serialize\DeSerialize. you can increase performance using precompiled serialization assembly that you are creating using the sgen.exe utility. 2.Sorry but i dont have a clue for this one.
-
basic questions about enumHi In the MSDN enum was declare as follow "The enum keyword is used to declare an enumeration, a distinct type consisting of a set of named constants called the enumerator list" 1. you need to understand that at the bottem line there is a native variable like int or short that can hold other values. for example: Days d = (Days)int.MaxValue; 2. "Assigning additional values new versions of enums, or changing the values of the enum members in a new version, can cause problems for dependant source code. It is often the case that enum values are used in switch statements, and if additional elements have been added to the enum type, the test for default values can return true unexpectedly." in case that you are using flags for bitwaise operation, if one or more enum value was changed you need to update your program to prevent unwanted if results
-
Sql Severs on the networkHi You can use one of the following options: 1. use the GetDataSources method that belong to the SqlDataSourceEnumerator class like the following: DataTable datatable1 = SqlDataSourceEnumerator.Instance.GetDataSources(); 2.use the EnumRegisteredServers method tht belong to the SmoApplication.SqlServerRegistrations class for furture instruction serch for smo objects in google
-
Sqlserver TriggersHi Use the DB triggers (INSERT, UPDATE) in order to log the changes that occur on the table, then use that log todo what ever you want
-
Attributes giving problemHi I saw from your example that you are using framework 3.0 or above Try using the follwoing code
List<BugFixAttribute> lst = new List<BugFixAttribute>((IEnumerable<BugFixAttribute> )inf.GetCustomAttributes(typeof(BugFixAttribute), false));
lst.Sort((a, b) => a.BugID < b.BugID ? -1 : 1);
-
I need helpHi try the follwing link: http://www.google.com/search?hl=en&q=Multi+Dimension+Arrays+c%23[^]
-
Comparing typeHi Try using the GetType() method instead of the Type keyword in your code
-
function rectificationHi If you want to return StoredProcedureInformation class instance you need to construct an unstance of this class and return it in your code you construct an array of StoredProcedureInformation and return the array instance.
-
Being more genericHi Try using the following code that use generics in order to construct the desired type sqlcommand
class Program
{
public static T SetupCommand<T>() where T : IDbCommand, new()
{
T cmd = new T();
cmd.CommandText = "SELECT * FROM Test";
cmd.CommandTimeout = 180;
return cmd;
}static void Main(string\[\] args) { SqlCommand sqlClientCmd = SetupCommand<SqlCommand>(); OleDbCommand oleDBCmd = SetupCommand<OleDbCommand>(); } }
-- modified at 6:21 Friday 5th October, 2007