|
Personally I always make any dynamically loaded object conform to a set interface, then you don't need to find the various properties of the object, but simple instantiate from the dynamic loader and cast. Makes life a lot easier. I'm wondering if you are trying to reference code not specific to your application, in which case you would have to do it your way.
http://www.codeproject.com/KB/library/dynamicloading.aspx[^] (The way I do it).
|
|
|
|
|
Hi,
I require this functionality for my undo/redo system. When an object property is changed via a property grid control, a property action is created. At the moment I am storing the property component along with the previous and new values. At various stages my program replaces some of these components, and so when the undo/redo action is later executed, the action is not actually undone to the current object. So instead I have done a trial which generates a property name string from the object by enumerating through the parent items of the changed property grid item. Then later this same string can be used to access the property again (using the method I posted previously).
I have read through the article which you have very kindly posted, however I do not think I can apply it for this particular application because some of the properties exist within the .NET runtime, and others are either of a dynamic variety, or exist within my C# code.
Thank you for your advise, it is greatly appreciated.
Lea Hayes
|
|
|
|
|
Crikey sounds complicated! Good luck.
|
|
|
|
|
Hi out there!
I have a question, looking 3 hours for any solution. Currently i'm very
confused. My Problem is quite simply (or isn't?)
I have following problem - i write a C# DLL. Ok, well, not difficult.
But imagine, someone other creates an C# DLL for me and i want to use it in my Project.
now i have an C# DLL and nothing more - now i want to load this DLL dynamic into my program.
like a plug-in... someone can provide some code? i played with System.Reflections but this seems to be very difficult. isn't there anything like DLLImport??? Or does this not work?
i'm open for any help!
Thank you!
FreewareFire is in the House!
|
|
|
|
|
This might be able to help: Google for reflection+.NET+plugin[^]
I looked at the first link and it has some information that might help. I would try to help more, but I am busy as the moment.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
|
Hi
i write this code :
CodeVariableDeclarationStatement cvds_dr = new CodeVariableDeclarationStatement(typeof(System.Data.SqlClient.SqlDataReader), "dr");<br />
method_getData.Statements.Add(cvds_dr);<br />
<br />
CodeVariableDeclarationStatement cvds_dt = new CodeVariableDeclarationStatement(typeof(System.Data.DataTable), "dt");<br />
method_getData.Statements.Add(cvds_dt);
now, i want to create dt.Load(dr); CodeMethodInvokeExpression by this code :
CodeMethodInvokeExpression invoke_dt_load = new CodeMethodInvokeExpression(new CodeVariableReferenceExpression(cvds_dt.Name), "Load", new CodePrimitiveExpression(new CodeVariableReferenceExpression(cvds_dr.Name)));<br />
method_getData.Statements.Add(invoke_dt_load);
but the bold code does not accept and the following error has shown me :
Invalid Primitive Type: System.CodeDom.CodeVariableReferenceExpression. Consider using CodeObjectCreateExpression
line of code that show error messsage is :
provider.GenerateCodeFromCompileUnit(compileUnit, tw, new CodeGeneratorOptions());
|
|
|
|
|
Hi!
I am using a DataGridView component in a simple C# application. I want to suppress the component to be initialized to only have 10 rows and no eleventh row is created what so ever. I have tried but have run out of ideas.
I will appreciate any kind of guidelines.
With thanks in advance.
|
|
|
|
|
I have an application that I was thinking would work much better if it could store it's files in a format similar to the OOXML concept. In other words, pack separate parts into a single ZIP file because it's a PITA to deal with my xml files and the external images that are associated with it.
It looks, to me, like you could use the .NET System.IO.Packaging namespaces to achieve this but I can find any examples that aren't writing something other than an OOXML or XPS file. Does anybody have some pointers on this? Am I barking up the wrong tree?
Cheers!
|
|
|
|
|
|
KaptinKrunch wrote: Have you read this page??
Yes I have. I was hoping to see an example that isn't creating an OOXML or XPS package to save me from any potential pitfalls.
I think I can use it, but I'll need to do some serious surgery on my application and I'll need to think very carefully about how much I should divide my file up and what the relationships should be.
|
|
|
|
|
Hi folks!
I'm coding a very simple Windows Application on VS 2005 (C#) in order to see the records of Customers table of Northwind database.
This Windows Application works fine by "Debugging" on VS 2005 enviroment with "Windows Authentication" to connect to the database.
Now, I thinking to deploy the application, so I created an "Application Role" in the Northwind database.
But, how do I use that Application Role in my application? How do I invoke it?
Can somebody help me?
(Details and reference to step by step guides will be appreciated.)
--
Adrián Córdoba
|
|
|
|
|
|
KaptinKrunch wrote: I'm waiting for the day google does not have the answer.
http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx[^]
KaptinKrunch:
I'm talking about to use "Application Roles" (from MS SQL Server's roles) in my application for connecting to the database. I'm not talking about roles for my applicaton.
In other words, how do I modify my application (now using Windows Authentication) to connect to the database by using an application role that I created in the database (SQL Server Management Studio)?
I saw several sites found by mean Google, but I didn't find a good guide for this purpose.
Anyway, thank you for your answer.
--
Adrián Córdoba
|
|
|
|
|
Can any plz temme dat ..how to put skins/template in winforms (C#'s desktop application )
asd
|
|
|
|
|
Unless you're using WPF, you have to buy it. Period. End of story. That's all she wrote. The fat lady sang already.
First - Buy this.[^]
Then - Read all of it's documentation thoroughly.
After That - come back with code problems (if you have them )
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
hhani wrote: how to put skins/template in winforms (C#'s desktop application )
You've asked this question before[^] and you were given an answer. Asking the question again will not change the answer.
What don't you like about the answer you were given already?
|
|
|
|
|
Colin Angus Mackay wrote: Asking the question again will not change the answer.
You must not of heard of Heisenberg's uncertainty principle.
|
|
|
|
|
Wjousts wrote: You must not of heard of Heisenberg's uncertainty principle.
Are you suggesting that the OP's brain is so small that it is operating only on the quantum level?
|
|
|
|
|
hey Colin!
So this was week three of my new job and I've been going through code to get familiar with processes. When I went through the SQL code I thought "Colin would have a heart attack. We have credit card numbers and not one SQL parameter." Then we get an email from the dept head reminding us about SQL injection as there have been some banks that have been hacked by SQL injection and to make sure we are using it. I was one of the few who knew about it and showed your article. I've yet to find any protected SQL statements--me thinks I need to talk to the boss.
|
|
|
|
|
leckey wrote: Colin would have a heart attack. We have credit card numbers and not one SQL parameter
Ouch!
leckey wrote: an email from the dept head reminding us about SQL injection ... and to make sure we are using it.
Gosh! I hope that was a typo and not his actual advice.
leckey wrote: I was one of the few who knew about it and showed your article
Fantastic, the more people know about it and how easy it is to protect against it the better the world will be. I've started teaching C# classes this year and I threw out the section on databases and re-wrote it from the ground up it was that bad. Thanks for using my article also.
leckey wrote: I've yet to find any protected SQL statements
I can forsee some refactoring in your team's future.
|
|
|
|
|
Oh, the heart attack comment was not appropriate for you. Sorry about that; I forgot about the medical issue. I hope you didn't take that personally (it sounds like you didn't)!
Yes, that was a typo!
I've already looked at refactoring when I found out a daily file process takes 45 minutes to run. It's part VB script and not using basic optimization tools. So many if loops one record can go through 10 if statements. Some are useless because the statement could never happen based on outer conditions.
Have you thought about publishing a book on SQL injection using real world examples of companies that got hacked?
|
|
|
|
|
leckey wrote: Oh, the heart attack comment was not appropriate for you. Sorry about that
Don't worry about it. I've never actually had a heart attack, although I do have heart failure.* I didn't take it as an inappropriate comment.
leckey wrote:
Have you thought about publishing a book on SQL injection using real world examples of companies that got hacked?
Although I'm keen to write a book, or at least a chapter or two of a book, I've not thought about SQL Injection Attacks as a topic. I've not actually done much with SQL Server recently and I'm concentrating more on LINQ these days. Having said that, I still do the occasional talk on SQL Injection Attacks if invited.
* I guess a heart attack is a form of heart failure. What I have currently is called Reduced Left Ventrical Function which is the byproduct condition of Transposition of the Great Vessels (or wonky plumbing around the heart as it was once explained to me). The blood flows round the body in a figure 8 with the heart at the cross over point. I was born with two figure 0s. The TGV was corrected when I was an infant, but the condition was such that the doctors couldn't correct it fully back to normal, so basically my heart runs the wrong way round. It freaks doctors and nurses out who don't realise this as they think they've connected me up to the ECG (or EKG) machine wrong. My ECG looks upside down compared to a normal person.
|
|
|
|
|
I remember you discussing the issue before; that's why I felt bad when you said "ouch" because I felt like I poked the bear, so to speak. So your Q-T rhythm is reversed? Yeah, that would be freaky! My late father died of a heart attack so I am very hyper-sensitive about heart issues now. I actually have a recurring abnormal-normal arythmia (heart beats abnormally, but the beat itself is regular; it comes and goes and the doctors don't know what causes it although I know if I have consumed too much niacin it kicks in) yet that didn't scare me much.
I should see if the next time you are in the US if my company would be willing to book you for a talk. I still think you should do a book; I don't know of anyone who learns about SQL injection in college.
|
|
|
|
|
First, read this: How to get an answer to your question[^]
Second, don't double post. You have already asked this question and your question has already been answered. If you need more clarification reply to that post
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|