|
You're welcome, and it does, using the <a href="http://msdn.microsoft.com/en-us/library/53seyfee.aspx">GetField</a>[<a href="http://msdn.microsoft.com/en-us/library/53seyfee.aspx" target="_blank" title="New Window">^</a>] method, also found on the objects' type. It'll return a <a href="http://msdn.microsoft.com/en-us/library/system.reflection.fieldinfo.aspx">FieldInfo</a>[<a href="http://msdn.microsoft.com/en-us/library/system.reflection.fieldinfo.aspx" target="_blank" title="New Window">^</a>] variable over which you can access it's content, or fetch it's attributes.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Dan_K wrote: The problem now is to make function calls from the class
You could use an interface.
|
|
|
|
|
You can use the reflection API to call methods, properties and fields of any class, including those that you've loaded from an assembly at runtime. This is what Eddy's pointed you at.
However, reflection is slow, and also pretty cumbersome to write code for. If you know what methods you want to call, then that means you can define an interface, and if you're writing the assembly you're trying to load from (or people are writing them to an API you specify), you can make sure the class you try to load implements it. Put that interface in a library that both the main application and the external library can refer to (this can be actually in the application assembly in some cases), and make sure that the classes you want to interact with in the external assembly implement it. You can then cast the result of Activator.CreateInstance to the interface and call methods on the instance directly.
There are several examples of plugin architectures (because that's what your close to) available on CP. Here's a simple example modified from a previous version of my LobbyClient (the current one loads plugins into a separate AppDomain which you probably aren't looking for):
public static IGameType LoadContent(String filename){
Assembly a = Assembly.LoadFrom(filename);
if(a == null) throw new GameLoadException("Assembly "+filename+" not found or not valid");
foreach(Module mod in a.GetLoadedModules()){
foreach(Type ty in mod.GetTypes()){
foreach(Type intf in ty.GetInterfaces()){
if(intf == typeof(IGameType)){
return (IGameType)System.Activator.CreateInstance(ty);
}
}
}
}
}
IGameType is specified somewhere that plugin classes can see it when you're writing plugins.
|
|
|
|
|
Dear All
I have created an application with database ms-access where i have defined all the field as memo data type to store hindi text . All data successfully stored and comes to crystal report in hindi text but when i look this data in datbase (ms -access) text displays in english but this is not issue.
Problem is when i give the print command all text prints in english text instead of hindi and also it is just same as displaying in database.
plz tell me the problem whether it is coming due to printer(HP Laser JEt J1008) or from the application.
|
|
|
|
|
It's not the printer; it does not care what language you're printing.
It's probably the database - with the text not saved as unicode, but in a specific format. I suggest you try a forum that's dedicated to Microsoft Access.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Try another printer with another type
I faced the same problem with Fast-report.net
It's worked with all kind of printer, but not these two HP 1010 , HP 1008
Due .NET ,,
|
|
|
|
|
I am working in a C# 2010 application where I have written the following lines of linq to sql code:
int TotCount = 0;
string[] PkgIDs = rptData.Transaction.Where(c =>c.Package_ID.StartsWith("rva") &&
c.Received_Date != null ).Select(c => c.Package_ID).ToArray();
foreach (string PkgID in PkgIDs)
{
var eCnt = rptData.Details.Where(c =>c.Package_ID == PkgID).Select(c =>c.TotalTrans);
TotCount = Convert.ToInt32(eCnt);
}
My problem line of code is: var eCnt = rptData.Details.Where(c =>c.Package_ID == PkgID).Select(c =>c.TotalTrans);
I want to be able to obtain the value contained in the c.TotalTrans field and place the value in the eCnt field.
When I am stepping through the code and go to the line right after the line I listed above, I only see the sql equivalent value. I want to see the value for c.TotalTrans in the eCnt field.
I know what I need now is to actually make the linq to sql statement actually execute. That would be similar to the 'ToArray()'
statement listed above. However, I do not know what to change in the statement to actually obtain the value.
Thus can you tell me what else I need to add to this statement so that I get my desired
|
|
|
|
|
Remember that the .Select(c =>c.TotalTrans) returns IQueryable<...> . You'll need to get the value from there. You probably want to use .FirstOrDefault() .
|
|
|
|
|
I'm a little confused about the TFS team project hierarchy.
From what I have read just about everything for your group (projects/applications/etc) should be contained in one TFS team project? Can anyone concur with that statement? I, for some reason, thought that a single team project in TFS was mapped to one VS project/solution, but I think I misunderstood the hierarchy. I know it can but it seems like complications will arrise when you have to work on two team projects in the same scrum iteration. The work items don't translate over from one project to another.
-- modified 21-Sep-12 17:53pm.
|
|
|
|
|
I don't think putting all your projects/solutions in the same Team Project would be very wise, mostly because, depending on the size and depth of them, it could become unmanageable pretty soon.
In the end I think it all depends on how your team likes to organize (especially, if you are gonna use TFS as more than a glorified VSS) but I prefer to have every solution in its own Team Project
|
|
|
|
|
If you keep each VS solution in one team project in TFS how do you handle situations where you have to work on two solutions with the same scrum iteration? Because you have different backlogs for each solution you would need to have two different sprints and that doesn't seem very efficient. right? You can't tie in work items from different team projects together and have them run under the same sprint/iteration. According to the TFS 2010 book by Wrox, one soltution they suggest is to put all applications into a single team project and seperate them by "areas" and "iteration". Isn't this a better solution then creating one team project for each and every solution given TFS limits team projects to something like 250 before performance degradation.
-- modified 21-Sep-12 18:06pm.
|
|
|
|
|
can we develop optical character recognition (OCR)using MonoDroid(convert C# code into Android).
|
|
|
|
|
I don't think your question is very clear, are you asking for people to just give you the code? If so, then the answer is NO, otherwise, please elaborate
|
|
|
|
|
my Question is i'm developing OCR for Android operating system using C#. there is a software called MonoDroid for android. i just want too know can we able to develop OCR using MonoDroid for Android..?
|
|
|
|
|
You need to research how OCR works and see if there is any sample code available. Google is your tool of choice here.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
In a C# 2010 desktop application, I am trying to determine how to write the following sql statement via linq to sql:
select COUNT(Tran_ID) as good_count
from dbo.Trans t
inner join dbo.table1 iw on iw.pkg_id = t.pkg_id
inner join dbo.table2 ip on ip.pkg_id = iw.pkg_id
inner join dbo.table3 tt on tt.pkg_id = ip.cust_Number
where (t.cust_Date is not null) and
SUBSTRING(ip.item_Number,1,3) = 'UC3'
Thus can you tell me and/or point me to a reference I can use to determine how to write the above statement in linq to sql that connects to a sql server 2008 database?
|
|
|
|
|
I'm usually using the 101 LINQ samples[^], browsable online.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Nice! I don't have much experience with LINQ and that is something definitely worth bookmarking
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hello All,
This is my first project/post in C# world
I want to send and read the commands from DOS using C#.
For eg. creating/deleting a file using edit myfile.txt command
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
string strCmdLine;
strCmdLine = "edit kiran.txt";
System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
but in above code only command prompt is getting opened.i cant able to create a file
Thanks in advance.
Kirangowle
|
|
|
|
|
|
Hi,
I have problem in IIS Server to connect sqlserver 2005.Blow error throw me when i access data from database.
"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."
Please help me.
Thanks,
Om.
|
|
|
|
|
Select the application pool in which your web site is configured to run, click 'Advanced Settings'. Under 'Process Model' set 'Load User Profile' to true.
|
|
|
|
|
Hi,
I have developed a console application which Send an email and export a Crystal report in pdf and attach with this email. This code is working fine on development system But on Server it gives following exception.
Quote: Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: orderackreport.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 505c3a77
Problem Signature 04: CrystalDecisions.CrystalReports.Engine
Problem Signature 05: 12.0.2000.0
Problem Signature 06: 489a2f19
Problem Signature 07: 2f7
Problem Signature 08: 43
Problem Signature 09: System.NullReferenceException
OS Version: 6.0.6002.2.2.0.272.7
Locale ID: 1041
Before this an Asp.net Application is hosted on same server and it is working fine. ( Also use crystal reports) but console application does not work.
Any Idea???
Thanks
|
|
|
|
|
At first this should be asked on ASP board
idreesbadshah wrote: but console application does not work.
Any Idea???
Well there is a System.NullReferenceException. One Object used seems not to be initialized correctly. Without seeing the code it's hard to say why.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
ASP.NET runs under a limited user, the console-app might require some additional permissions. I suggest you debug the app, and post the code where it generates the exception here.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|