|
loyal ginger wrote: can c# not functions double 3/4 4/3 converts
Does that mean you understand the OPs question?
In which case, could you explain it to me, in English?
Oh, and your answer, please!If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
I am just talking in the same language as the original poster. I can communite with him quite well this way. I understand the frustration you guys have with my post. However, my post is just another way to express the same frustration we all have.
We really need more sense of humor in this place. In my place we don't have much of anything interesting. By the way, my mother tongue is not English -- it's some language many people don't understand. I am glad we have a common platform to communite.modified on Saturday, February 6, 2010 9:13 PM
|
|
|
|
|
Hello,
I have a question. Is it not worth investing my time on C# more and more rather than stopping learning C# and move to a functional programming like F# ? The reason I am asking, I read somewhere that, F# is the future of C# and VB, so wont there be imperative programming valuable anymore ? I would be excited to hear that, C# is much worth and it got future. I love C#/LINQ. I cannot think about a programming language which looks like VB (I mean, no braces).
Would anyone share your opinions!!
Regards
|
|
|
|
|
F# isn't going to replace C#, but complement it. Each language has it's own merits, and they will not compete as such.I are Troll
|
|
|
|
|
I'm not agree with you; as you think:
Emran Hussain wrote: that, F# is the future of C# and VB
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Emran Hussain wrote: F# is the future of C# and VB
Yeah, but then iSharp will kill all the other languages....
Learn good practices, that you can use on all languages, instead of just "learn the language".
|
|
|
|
|
Functional programming languages have been around before F#, and they have never come close to the kind of popularity that C# or VB currently have. The simple reason is that while they have an academic appeal, people simply don't think in a purely functional manner. David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hello all, Could somebody tell me how can i close all the windows opened in my windows application.
The flow is like this from login to main window from main window to all other windows.
when i click the logout button in main window it should close all the opened windows in my application and the login window must be shown..
Thanks in Advance..
|
|
|
|
|
The easiest way is to make you login form your default form. When the user logs in correctly, show your "real" main form, and Hide the Login form. Then all you have to do is chain into the various close events:
Login Form (on login ok):
MainForm mf = new MainForm();
mf.Show();
mf.FormClosing += new FormClosingEventHandler(mf_FormClosing);
Hide();
Login Form (event handler):
void mf_FormClosing(object sender, FormClosingEventArgs e)
{
Show();
}
At this point, you main form will show when you log in, and the login form will reappear when the main form closes - so your logout button just needs to call "Close()".
Then when you construct each child form, give it a single parameter constructor:
public ChildForm(Form parent)
{
InitializeComponent();
if (parent != null)
{
parent.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing);
}
}
void ParentForm_FormClosing(object sender, FormClosingEventArgs e)
{
Close();
}
Then, when the forms parent close, so will the child.
So, construct your child forms as necessary:
ChildForm cf = new ChildForm(this);
cf.Show();
And when the main form closes, the child forms will also close, and the log in screen be re-displayed.If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
Are you aware of Application.OpenForms ?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Sorry i am not aware of application.openforms. Can i get the name of the open windows using this property.
|
|
|
|
|
You get an array of Form references, as the documentation would tell you.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Mohan,
try this. Call this method in the Button Click event.
public static void CloseAllForms()
{
//Create a Collection to Store all Opened Forms.
List<Form> formsList = new List<Form>();
//All all opened forms into a Collection.
foreach (Form frm in Application.OpenForms)
{
//Execulde the Current Form.
if (frm.Name == "Form1")
continue;
else
formsList.Add(frm);
}
//Now Close the forms
foreach (Form frm in formsList)
{
frm.Close();
}
}
|
|
|
|
|
Hi,
In my application I am very much using the System.string class for every manipulation of characters (Reading a lot of data from a XML file, writing a lot of data in a XML file and creating log for each operation). If my application needs to run for 24 hours, I know how inefficient it can be using System.string. How can I replace System.string with StringBuilder? Like in System.Xml.XmlElement object, its inner member InnerText is itself a System.string object. Similarly in System.Xml.XmlNode object, its inner member InnerText is also a System.string object. So when too many classes of .net framework are using System.string type for their members (instead of StringBuilder), how can I replace System.string with StringBuilder?
I am not getting any clue to come out of this problem. Even if I use StringBuilder, too many .net classes do not accept it. Using System.string or StringBuilder.ToString() can make my application really inefficient. Please help me to know how to go about it? Also let me know when System.string get collected by Garbage Collector?
Thanks in Advance
Aseem
|
|
|
|
|
Hi,
StringBuilder is Benificial in case of string manipulations like concat string for no of times. Then use StringBuilder and add method to create result string. But when you got final string then You can use String object.Best Regards,
Chetan Patel
|
|
|
|
|
|
StringBuilder is only going to be more efficient than a string if:
1) It never gets extended - each time it does, it gets re-allocated, just like a string.
2) If your code repeatedly changes the string content.
If you are allocating strings and keeping them allocated, then replacing them with StringBuilder (which you can't do for System.Xml objects) will not make any real improvement unless you overwrite the StringBuilder content.
How are you allocating / using the strings?
If you app is running for 24 hours, what happens?
Strings are collected by the GC when it feels like it (i.e. when it needs to make some space for a new allocation), but will only be collected when there are no further references to them.If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
Earlier I was under a wrong concept that System.Strings are not collected by GC. Thanks for correcting me.
|
|
|
|
|
You are welcome! Everything is subject to the GC as soon as it's last reference is removed. If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
Well, StringBuilder is used when you want to build up a big string by concatinating small bits together. It's used as strings are immutable, that is they can't be changed.
So, if you add two strings together, a third is created and the contents of both are copied over. Obviously this causes problems if you do it repeatedly, and StringBuilder exists to mitigate this performance problem.
In terms of GC, I believe that strings are collected in the normal manner like any other object, that is at some undeterminate point after all references to it no longer exist.Regards,
Rob Philpott.
|
|
|
|
|
You can't change the return values of framework object methods (and indeed, you don't want to) . In your own object methods, you can use StringBuilder internally if necessary, but unless you have a very specific reason for doing so, there's really no reason to return a StringBuilder object.
A StringBuilder is a more efficient object when frequent changes to a given string are made, but it saves you nothing as a return value unless the method being returned to is also going to heavily modify the returned value.
If you're concerned with memory usage, buy a memory profiler, and run your app for a few days to see if this is indeed something that even needs to be considered. You may find that your efforts are best concentrated elsewhere in the code..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi all,
I am a beginner and have many doubts.some of them sorted out but in some i m stuck.here is the one:
i have a databse and a table in that. ex tbl1 with columns firstname and lastname.
i have 2 textboxes on my form and want to populate those text boxes from the table.
i tried one techniquie using datareader but it is showing the last data of the table. i want on formload the first row to be populated on the specific textboxes.
secound problem is that i want to transfer the data in this form to another page as it is and populate controls of another form by value of this form controls.
|
|
|
|
|
1) Use Top 1 Query while you are loading data from DataBase.
Now you got the first row.
2) If you want to transfer the data from one form to another.
Then if you are using MDI form then
You can access All Control like
Form1 obj=new Form1()
Form2 obj2=new Form2()
obj2.TextBox1.Text=obj.TextBox1.Text
If you are opening form from another form then
obj.TextBox1.Text=this.TextBox1.Text
Still it is not resolved then post minimum code required to help you better.Best Regards,
Chetan Patel
|
|
|
|
|
I don't know why you suggest to use top 1 in the select sql statement...There are many ways to manage if your query return multiple rows. Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hi All,
Can anybody help me what does the below code do and whats the use of new here. Any link also will be fine.
public abstract class BaseCollection<T> : List<T> where T : BaseEntity, new()
{
public bool MapObjects(DataSet ds)
{
if (ds != null && ds.Tables.Count > 0)
{
return MapObjects(ds.Tables[0]);
}
else
{
return false;
}
}
public bool MapObjects(DataTable dt)
{
Clear();
for (int i = 0; i < dt.Rows.Count; i++)
{
T obj = new T();
obj.MapData(dt.Rows[i]);
this.Add(obj);
}
return true;
}
} Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
modified on Friday, February 5, 2010 7:31 PM
|
|
|
|