|
In fact, we have an application developped with J2EE and I must develop an application with C# that does the same fonctionnalities.
the J2EE application uses the meta data to do some treatments and also add other meta data to the program (additional informations about classes needed for the development).
So, i'm searching some documents that explain how to access to the meta data of c# classes , how to manipulate them, and also how to add new meta data specific to my application.
If you know some documents, sites or refernces, please reply me, I will be very grateful.
thank you!
|
|
|
|
|
You need to google for reflection and c#. To give you a taster, suppose that you have a class called MyClass and that you want to know what the properties are, you can do the following:
Type classInfo = typeof(MyClass);
PropertyInfo[] pinfo = classInfo.GetProperties();
foreach (PropertyInfo pi in pinfo)
{
Console.WriteLine(pinfo.Name);
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Greetings,
I'm working on a web application with a dynamically creation of a gridview and within this gridview a dropdownlist (ddl) for data validation;
Everything needs to be programmed dynamically in c# code.
The creation of the grid + data is very easy, but on 1 field I want a ddl, so that people can only choose from certain data in this ddl.
//GridView GridView2 = new GridView();
GridView2.ID = "Ellende";
GridView2.AutoGenerateColumns = false;
//GridView1.DataKeyNames = new string[] { "EmployeeID" };
GridView2.AllowPaging = true;
GridView2.AllowSorting = true;
GridView2.PageSize = 5;
BoundField bfName = new BoundField();
BoundField bf1 = new BoundField();
BoundField bf2 = new BoundField();
CommandField cf = new CommandField();
cf.ButtonType = ButtonType.Button;
cf.ShowCancelButton = true;
cf.ShowSelectButton = true;
bf1.DataField = "Task1";
bf1.HeaderText = "Task1";
TemplateField tf1 = new TemplateField();
tf1.HeaderText = "Task1";
DropDownList dl1 = new DropDownList();
dl1.DataSource = ObjectDataSource3;
dl1.DataValueField = "Recid";
dl1.DataTextField = "Status";
dl1.SelectedValue = "Task1";
GridView2.Controls.Add(dl1);
GridView2.Columns.Add(tf1);
//GridView2.Columns.Add(bf1);
bfName.HeaderText = "Employee Name";
bfName.DataField = "Name";
bfName.ReadOnly = true;
bf2.HeaderText = "Task2";
bf2.DataField = "Task2";
bf2.ReadOnly = true;
GridView2.Columns.Add(cf);
GridView2.Columns.Add(bfName);
//GridView2.Columns.Add(bf1);
GridView2.Columns.Add(bf2);
GridView2.Columns.Add(bf3);
GridView2.DataSource = DT;
GridView2.Visible = true;
GridView2.DataBind();
The main problem is that under "Task1" I need to connect the dropdownlist somehow to the gridview when using c# code dynamically.
I found out that I need a templatefield.
The gridview is filled with data when using a dataset--> that easy.
But the field with "Task1" needs to be connected with a ddl, from which a choice can be made.
When choosing a value from the ddl --> this value needs to be stored in the datatable DT.
How can I connect a DDL (with predefined data) in a gridview????
I hope somebody has an answer in c# or VB
Greetings Peter Bellen
bellenp@schneider.com
|
|
|
|
|
First off can you mention what a DDL is, as far as I know because I haven't done much web development it stands for Data Definition Language.
Secondly this might be better answered in the ASP.NET[^] or Web Development [^] forums.
|
|
|
|
|
Hi,
i want to send some emails in c#. I found some information about the smtp client class and I've implemented it. I want to use the gmail-Smtp Server. The gmail guys publicate on their page that you need a TLS encryption.
How can I use a TLS encryption in C#?
Thanks
spotl
|
|
|
|
|
There's a flag you set in the SmtpClient class, something along the lines of EnableSSL .
|
|
|
|
|
I've built a fairly simple windows service and tried installing it on my local machine via both installutil.exe as well as a setup/deployment project. Both types of installation indicate a successful install, however, the service is not listed in the list of services on my machine.
I've searched Google, etc to no avail....any tips or things I should be looking for?
Thanks a million,
Brent
|
|
|
|
|
I would guess that perhaps you are looking for the wrong name. The only other option is that installutil was not successful in installing the service. On your ServiceInstaller there is a SErviceName
ServiceInstaller.ServiceName
This must have the name of your service for it to show up.
Here is an article I wrote that has some sort code with a window service in it.
http://www.codeproject.com/dotnet/OpenFiles.asp[^]
Hope that helps.
Ben
|
|
|
|
|
i m using a hash table taking a string as a key and an arraylist object as a value .. each time the arraylist value changes for the second and further entries in the hashtable all the values of the hashtable changes according to the new entry in the arraylist i.e in the end all the different keys hav the same value pair that is the last entry in the array list y is it replacing the previous values of the hashtable arraylist once its been added to the hashtable
|
|
|
|
|
ArrayLists are reference types so by default variables are simply pointers to the same object in memory, so what you're storing is a pointer to the same array. What you want to look into is the Clone method which will return a copy of the array list, this should fix your problem.
|
|
|
|
|
Thanks A BUNCH .... u really did help me a lot thanks a lot .. i was working on it for 2 weeks thanks again
|
|
|
|
|
In solution explorer, I noticed that the Form1.Designer partial class is listed under the Form1.cs
I created some other partial class(Myclass.cs) of From1 but it doesn't appear under the Form1 in solution explorer. Is there anyway I can get it to appear under Form1.
Currently
-Form1.cs
|
----->Form1.Designer.cs
|
----->Form1.resx
...
...
MyClass.cs
Looking for
-Form1.cs
|
----->Form1.Designer.cs
|
----->Form1.resx
|
----->MyClass.cs
.....
|
|
|
|
|
Try prepending Form1 to MyClass.cs. The solution explorer tries to logically put everything together by their file name. If you write Form1.MyClass.cs, VS should see that file as a subset of your Form1 and show it in the tree as such.
|
|
|
|
|
It doesn't do that automatically, see my response to dino2094.
|
|
|
|
|
There's no way to do this automatically in VS but you can do this:
- Right click the project in the Solution Explorer and select Unload Project.
- Right click the project again in the Solution Explorer and select Edit
Project.csproj - Look for an XML element which is like
<Compile Include="MyClass.cs" /> and change it to:
<Compile Include="MyClass.cs"><DependentUpon>Form1.cs</DependentUpon></Compile> Close the project file in the editor and reload the project like in step 1, your file should now appear under the Form1 node. Note you could specify Form1.Designer.cs and it'd be displayed under that one instead.
|
|
|
|
|
I just saw myself after digging into the project file, when I couldn't repeat what I was talking about. Thank you for showing my ineptitude!
|
|
|
|
|
|
Hi! I want to know is there some in built functionality into Dot net framework which can be used to send mails thourgh Exchange Server.?
Thanks
Don't Quit
|
|
|
|
|
Could anyone tell me how to populate a javascript array using a dataset result from a database.
JT
|
|
|
|
|
You could always use RegisterStartupScript to inject some JavaScript that would do this, or you could use Ajax to control this. Personally, I would go with the Ajax route as this is a much more flexible way to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Iam trying to get the log on information for a windows service.
does any body know how to get this.
I know you can use serviceinstaller to create a service and define the username and password for it.but how does one get the username for already existing service
|
|
|
|
|
Look at the service in Control Panel > Administrative Tools > Services. Select the service you want, right click it and select properties. Look under the Log on tab and you will see who it logs in as (either the local system account or the named account).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
well iam trying to get that programatically in C#
|
|
|
|
|
Hi
Im using Microsoft Word 11.0 Component to create the word document., after completing all the process i have close all reference but still WINWORD.EXE is running in my system process.
Here is my code ....
static Word.ApplicationClass wa ;
static Word.Document wdHeader;
wa = new Word.ApplicationClass();
wdHeader = wa.Documents.Add(ref templateFile, ref missing, ref missing, ref trueObject);
wdHeader.Activate();
wa.Visible = false;
object falseObject = (object ) false ;
wdHeader.Close (ref falseObject , ref missing , ref missing );
wdHeader = null;
wa = null;
Still what i have to do to take under control since i repeat the same for 500 times then system may get crash. Please help out.
Thanks in advance...
|
|
|
|
|
My goal is to append a session id to the messages the remoting client sends out.
I have the following code in my client that adds a sink to the client channel:
BinaryClientFormatterSinkProvider provider = new BinaryClientFormatterSinkProvider();
provider.Next = new ClientSinkProvider();
IChannel chan = new TcpClientChannel("SADeskSession", provider);
ChannelServices.RegisterChannel(chan);
ClientSinkProvider is my provider class that creates a sink that implements IclientChannelSink and IMessageSink.
in the processMessage method on this sink, I have it appending something to the message's Properties object, however, the serverside sink cannot read this as it should.
I must be missing some nuance, as I am a complete novice to remoting.
Can someone put me on the right direction? I'm basing this off this article, but my needs are simple enough that I don't need classes as robust as the ones in the article.
http://www.codeproject.com/csharp/customsinks.asp
|
|
|
|