|
Hi Le Centriste,
Thanks very much for the suggestion but the way the DBA here controls his database borders on the psychotic. By the time he considers the request and then (if?) actually actions it, I'd hope to be able to achieve the same thing programatically...
Any more ideas anyone?
Scotty
|
|
|
|
|
save it to XML or in a new table in data base
With reference of the file and a flag of file usage
check it every time user tries to access the file (and don't forget to cleanup after user finished working )
Regards
Amar Chaudhary
|
|
|
|
|
As in ASP.Net 2.0 do we have any thing like Membership API for windows application???
|
|
|
|
|
No, not for Windows, AFAIK. Pretty easy to write, tho.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I was developing a small project using .Net 1.1, and here's some details:
public class MenuList
{
private Hashtable MenuItems= new Hashtable();
public void AddMenuItem(MenuItem oItem)
{
MenuItems.Add(oItem.Name, oItem);
}
public MenuItem this[string name]
{
get
{
return (MenuItem)MenuItems[name];
}
}
}
public class MenuItem
{
public string sTitle;
private string sName;
public string Name
{
get
{
return sName;
}
set
{
sName=value;
}
}
}
In this way, I can create MenuItem, add to MenuList, and access the MenuItem through it's name:
MenuItem i1=new MenuItem();
i1.Name="i1";
MenuList l1= new MenuList();
l1.AddMenuItem(i1);
l1["i1"].sTitle="abcd";
My question is: clients request to access the MenuItem this way:
l1.Items["i1"].sTitle="this way";
So how can I do it?
Yours Tully
Huang Kai
|
|
|
|
|
hi,
public Items[string name]
{
get
{
return (MenuItem)MenuItems[name];
}
}
I would recomend Implementing IList though. If you we're using .NET 2 it would be great. You could implement IList<t>
But you can still use IList:
class MenuList : IList
{
}
Gideon
|
|
|
|
|
Thanks. But it seems not working in .Net 1.1
|
|
|
|
|
Hi,
giddy_guitarist wrote: public Items[string name]
does not work for me on .NET 2.0
according to documentation indexers always require "this" keyword as in
public this[string name]
|
|
|
|
|
hi,
I'm sorry , i answered very hastily. That was really silly , you're right. You cant do anything like what i mentioned earlier.
I do know , that .NET classes that have an items collection return a strongly typed object collection.In other words , what Items returns IS A LIST(Like the ListBox.Items , ComboBox.Items etc).
Usually they are used only because you need for something to happen when the collection changes.For example , when one adds/removes objects from the ListBox.Items the listbox updates.
If you still want to do what you want , you could do this:
class MenuItemCollection : IList
{
}
//since you're using .NET 1.1 i dont think you can make a strongly typed collection , so you could write you're own collection (Without IList) that takes MenuItems (IList takes objects)
Then :
class Menu
{
MenuItemCollection _items; // this should be initialized somewhere.
public MenuItemCollection
{
get{ return _items;}
}
}
You can check out the .NET classes with the object browser in VS or with reflector to get a better idea.
Hope i helped.
Gideon
|
|
|
|
|
You have to use an indexer, but that would be l1["i1"].sTitle="this way"; instead of l1.Items["i1"].sTitle="this way";
If you want a bit of advice, discourage the clients from using it this way. Because if the "i1" menu item does not exist, null will probably be returned, which would lead to an unhandled NullReferenceException . This is bad practice.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
I want to get the System name, for that i have used the SystemInformation class when i applied this in windows form it is working nice and when i am writing this in the windows service it is showning an error that this doesn't exist in the current context. for this i have to include the namespace System.Windows.Form.
Is there any other opt method in order to get the system information in windows service otr this is the only way .
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
If it just the system name then use System.Net.Dns.GetHostName
|
|
|
|
|
Thank you Manas.
It solved my problem
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
or Environment.MachineName
|
|
|
|
|
Hi,
I have two windows application forms(form1 & form2).. In the form1 i hv a textbox asking for phonenumber. When ever user enters the phone no. in the text box, I want to display that data(ph. no) in Form2..
IS this possible by any way? if so, how can I achieve it?
Could any one please shed some light on it.....
Thanks in Advance.
-- modified at 6:20 Thursday 28th June, 2007
|
|
|
|
|
These are web forms ? You can store data in the session, put it on the URL, or do a cross page postback.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry, i mean to say windows application forms...
like form1.cs & form2.cs
sorry again...
|
|
|
|
|
Create a property/variable in Form2.
Assign phone number to it.
|
|
|
|
|
Code snippets:
Form1:
string ph_no="121212";
Form2 frm2=new Form2();
frm2.ph_no=this.ph_no;
frm2.Show();
Form2:
public string ph_no;
form_load()
{
Messagebox(ph_no);
}
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Hi,
Thanks for your reply...
but its giving me this error::
"An unhandled exception of type 'System.StackOverflowException' occurred"
Thanks..
|
|
|
|
|
Most likely cause is: the set part of your property is assigning a new value to
the property itself, rathet than to some local variable (upper/lower case!).
|
|
|
|
|
When you place the Masked Textbox on form and set the Mask property, text box shows the preview of masked format. e.g. if user has selected integer with 5 digit as mask then Mask Textbox will display the text as"_____" in the text box.
At the runtime also user will see "_____" as text in the textbox, until any value is entered. If user enters one digit(say "1") then text in the text box will look like "1____". So dynamically user is guided about the possible formatting and value which user can key in. If I don't want to use the masked text box and i make a control derived from text box how this dynamic preview like masked text box can be implemented?
I request people to look at the functioning of the Masked textbox once for better idea of what I'm looking for. Pls come up with your ideas.
|
|
|
|
|
Create a new control that inherits from MaskedTextBox.
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
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
|
|
|
|
|
Dave, Thanks for your reply.
But solution suggested by you is not the one I'm looking at. I need to develope the things considering that I'm developing on framework 1.1 and Masked Textbox object doesn't exist at all.
At the most I can derive my custome control from TextBox only.
I just need some ideas from members.
Thanks.
|
|
|
|
|
KrunalC wrote: At the most I can derive my custome control from TextBox only.
I think you've just answered your own question.
Have a look at this[^] and this[^]. I think you should get a few ideas from the results on the first link.
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
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
|
|
|
|