|
Hi, I am trying to understand how reflection works dynamically..
For that I am trying to call the Console.WriteLine static method dynamically..
This piece of code works where I call the WriteLine(string) method:
Type console = typeof(Console);
MethodInfo writeLineMethod = console.GetMethod("WriteLine", new Type[] { typeof(String) });
writeLineMethod.Invoke(console, new Object[]{"NewBie0915"} );
However when I try to call the Console.WriteLine(string, object) method, it dosent call it !!
Please tell me why... In the following code, only "Hey" is displayed instead of "Hey NewBie0915!"..
Type console = typeof(Console);
MethodInfo writeLineMethod = console.GetMethod("WriteLine", new Type[] { typeof(String), typeof(Object) });
writeLineMethod.Invoke(console, new Object[]{"Hey ", "NewBie0915!"} );
Does it have problems converting from String to Object? I am not able to understand this..
Any help would be appreciated..
Thanks !!
|
|
|
|
|
Because you missed "{0}" in the string
"Hey {0}"
|
|
|
|
|
Hi,
I have created a certificate both private and public key (created using MS SQL Server, and Visual Studio Tools), which I have imported into the Certificate Store under Trusted People, Machine Level.
I have a program that encrypts sensitive data on that server, using the private/public key.
I kan run the same program to decrypt data encrypted on the same machine, but when I run the program on another computer (using the same private key, in this case the pfk file) I'm getting error when I run decryption.
I also discovered that when I use the certificate store certificate to encrypt, and load the pfk file into my program to use that private key to decrypt the same data I fail to decrypt it.
I'm using .net X509Certificate lib, with RSA provider and CSParameters, on Windows Platform, both XP and windows server 2003.
I have read some worring comments that using certificate store to encrypt data, you have to decrypt this data using the same machine. Would this be the case, I'm not able to find any threads on the internet about this issue.
If there is an issue with encryption/decryption across machines using the certificate store facilities, which method would you recommend to ensure decryptablilty across machines?
I'm writing the code in C#, but it could be any managed code in .net.
Hope some here have some fact and tips in this case.
Thanks,
|
|
|
|
|
From what I have read on using Key Stores you need to access the one one the local machine. That is why I normally store keys in a db or such of my own creation. One of the biggest limitations of PGP, IMHO, is the limited manner in which there key store works; Windows suffers a similar fate.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
how should i dislay the pie chart using c#
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Here[^]
And the first result is from right here at CP.
Imagine that.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
buddy ,
I am able to export data to excel from my dataset, but problem is in displaying the charts to excel from c#.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Pankaj Garg wrote: but problem is in displaying the charts to excel from c#.
In your first post you didn't mention that. So please try to be specific when asking question in this forum.Here every body try there best to give solluation.
Pankaj Garg wrote: I am able to export data to excel from my dataset
now , where do you want to draw the Chart in C# Application or in Excel itself.
as per you question you want to draw chart in Excel,
please correct me if i am wrong.
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
i have data , and pertaining to that , i want to create a excel file for the pie chart.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Hope This will helps you
create Excel graph in c#[^]
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
i need help in c# , code is aailable there in the same language.but in few places, the code is quite confusing, datatype is not declared .i mean code is incomplete.
do u have any other link?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
|
Hi all,
Im having problem with Simple style combobox.
actualy i have a form window with a combobox and other one is Textbox.
combobox style is Simple(CBS_SIMPLE). there is so meny text. when user type some text and hit enter key it will be select current item.
but its nothong happen. user have to press down arrow.
my question is this.
i don't wanna use down arrow key, i want to use enter key to sellect current item.
what its posible to change Keys event?
please give me any idia with small source.
thank you
bir
|
|
|
|
|
Member 4129218 wrote: when user type some text and hit enter key it will be select current item.
where should user , enter the text, is it in the text box?
i think you want, when user give some text in text box and press enter then it should add in combox box and current enterted text should be selected.
Please confirm
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
Hi Abhijit Jana,
type in the Simple type of ComboBox.
Simple Stype comboBox Layout.
----------------
| Monitor \/ <- type monitor and hit enter
----------------
| Computer |
| Proccessor |
| Monitor |
----------------
This is a CBS_SIMPLE Type ComboBox.
When user type Listed item Monitors and hit enter, in that case Listed monitors must be highlighted.
i did alot but nothing happend.
in default user type listed item and press down key its work but i don't want that i need to effect by Enter key.
Please help me.
Sincerly Bir
|
|
|
|
|
Hi all,
please give me answer.
|
|
|
|
|
Hello all. I have a couple of questions regarding assemblies.
Can an assembly contain other assemblies?
Can an assembly directly contain types?
Any help would be appreciated. Thanks.
"If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra
|
|
|
|
|
Check It[^]
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
I'm using DataAdapter.Fill() in my ASPX code. It takes rather long time to be completed and if I refresh page in IE causing thereby second invocation of .Fill() I get the following exception:
There is already an open DataReader associated with this Command which must be closed first
How can I fix this error?
|
|
|
|
|
One DataReader per one connection.
When you refresh, another readers is instantiated for the fill method and the same connection is used and thus exception is thrown.
|
|
|
|
|
Don't do that.
Check to see if it's already filling before trying to fill?
Cancel the existing fill operation?
|
|
|
|
|
Ok, how can I do this checking?
|
|
|
|
|
Perhaps check the .IsClosed property?
/ravi
|
|
|
|
|
DataReader is connection based. When a DataReader is opened, it engross the connection till close it.
So, After you use a DataReder, you must close it immediately.
|
|
|
|
|
Hi
You can check with ConnectionState property.
|
|
|
|