|
Database, ie SQL CE.
Faster or not depends on how you use it. Do you load the XML into memory once and use the data from memory? or do you have to query the XML every time? If you load them into memory, you will be hogging a lot of memory.
You won't know if you wake up one day, the requirement has been changed to 6000 records, must be able to add or delete, and changes needs to be deployed to 500 users.
|
|
|
|
|
darkelv wrote: If you load them into memory, you will be hogging a lot of memory.
How do you know? He hasn't said what the 500 records are! It might be 500 IDs with a string value consisting of a few words (lets say 20 chars average). That is 24 bytes (or 44 for Unicode). So that is a whopping 22K. Wow! That's a real memory hungry application.
darkelv wrote: You won't know if you wake up one day, the requirement has been changed to 6000 records, must be able to add or delete, and changes needs to be deployed to 500 users.
Where did he say he had 500 users? And why couldn't the XML file be located in a central location on a network?
You are making a lot of assumptions that were not in the original query. If you are going to do that then you should say that these are your assumptions and therefore they may possibly not apply to the situation.
|
|
|
|
|
Feeling cranky, eh.
That's what the "if" for.
Since he didn't supply more information, I am giving him something to ponder before he decide what he want to do.
|
|
|
|
|
darkelv wrote: That's what the "if" for.
No, it wasn't. You said: "If you load them into memory, you will be hogging a lot of memory." That indicates that you have already made the assumption that the data set is large, not IF the data set is large. I pointed out a fairly reasonable scenario where the data set wouldn't really take that much memory.
|
|
|
|
|
Pankaj - Joshi wrote: I'm having 500 hard coded records in a database. Now I thinking about to make a XML for that..So Which one is faster...? A XML file or a database table ..?
It depends on what you are using these records for. How do you intend to query them? What do they contain?
Pankaj - Joshi wrote: If a XML is faster then what is the best way to retrieve the data from it...?
For example, if the data is a simple key/value lookup then loading it into a Hashtable may be the best thing to do. However, it really depends on what this data is.
|
|
|
|
|
XML is very faster than Database
Like a good handsome...thanking You
|
|
|
|
|
anandakumarm wrote: XML is very faster than Database
That is a very wide sweeping statement that is incorrect in most scenarios.
|
|
|
|
|
hi,
I have written a pllication using C# and asp.net which set the windows user password using WinNT protocol. It is working fine.
But before setting its password i want to check whether the account is locked or not if account is locked then unlock it.
Plz. give me help how to unlock windows user(2003 server) account using System.DirectoryServices; My code is as below
string entryString = "WinNT://" + Environment.MachineName + ",computer";
DirectoryEntry dirEntry = new DirectoryEntry(entryString);
DirectoryEntry osUser = dirEntry.Children.Find(username, "user");
if (osUser == null)
{
_ErrorMsg = "Such OS user not found.";
}
else
{
if (changepassword)
osUser.Invoke("SetPassword", newpassword);
}
osUser.CommitChanges();
|
|
|
|
|
I had a abstract base class :
namespace ConsoleApplication1
{
public abstract class AbstractClass
{
abstract protected void TestFunction();
abstract internal void TestFunction2();
}
}
Now, I wanted to inherit this class as :
namespace ConsoleApplication2
{
class Client:AbstractClass
{
public Client()
{ }
protected override void TestFunction()
{}
}
}
As the namespace for the above classes are different, we can access the "abstract protected void TestFunction();" in the derived class. But we cannot access and override "abstract internal void TestFunction2();".
Because of this I am getting a compile time error.
How to deal with this problem? Since I want the internal method as it is and still want to compile the application.
|
|
|
|
|
Mukesh Choudhari wrote: we cannot access and override "abstract internal void TestFunction2();".
Internal methods can't be accessed outside the assembly. It can be accessed in the same assembly. Consider moving it to the same assembly.
|
|
|
|
|
Yes it worked when I moved it to same assenbly.
But what if I had this class in a DLL and I am using this DLL in some other project. Now since the class has a "internal abstract" member in it, I won't be able to inherit this class.
Is there any other way that we can inherit this class and it will not ask for overriding the "internal abstract" method?
|
|
|
|
|
Mukesh Choudhari wrote: Is there any other way that we can inherit this class and it will not ask for overriding the "internal abstract" method?
Only method I am getting is making the second class as abstract too.
|
|
|
|
|
N a v a n e e t h wrote: Only method I am getting is making the second class as abstract too.
How would that help? Surely removing the internal qualifier would be a better solution in this case. He wants to use it outside the assembly in which it is defined, therefore qualifying the class as internal would go against this desire.
|
|
|
|
|
Yes it's a bad solution, I know. But since he don't want to remove internal from the first class, I just thought in this way.
|
|
|
|
|
Mukesh Choudhari wrote: Now since the class has a "internal abstract" member in it, I won't be able to inherit this class.
If you need to access the class from outside the assembly in which it is defined then don't define it as internal .
|
|
|
|
|
hi
no there is not possibility to avoid having to override an abstract member. but if you don't mind overriding the member though you can qualify the member as protected internal . then you will be able to override it from an other assembly.
greets
m@u
|
|
|
|
|
m@u wrote: protected internal. then you will be able to override it from an other assembly.
I doubt this. Because you won't get access to the internal method defined in the assembly. So how this can be written ?
|
|
|
|
|
try this:
create assembly with this class in it:
public abstract class TestClass
{
protected internal abstract void foo();
}
and then in a seperate assembly that references the first one and create that class
public class TestImplemented
{
protected internal override void foo()
{
Console.WriteLine("Horray it works!");
}
}
theory says it'll compile and work properly
you could even override it as protected only to avoid visibility in the second assembly
|
|
|
|
|
Yes it worked. But then what would be the use of internal ? In your example, I am not getting any role for internal.
|
|
|
|
|
yes you're right in my example, the internal doesn't have any effect. but i modified (i should think longer before posting ) the post. you can override a protected internal as protected and then the member will not be accessible from the second assembly.
|
|
|
|
|
Hi all,
i am trying to make a form that contains..
A Button and a text area
so on click of button it will show what ever in text area..
can anybody help me...
T@SU
|
|
|
|
|
I think you should read C# tutorials or buy a C# book.
1. You can add the button and textarea from Toolbox to your form.
2. In OnClick event of Button, you can get the value of textarea (e.g. TextBox1.Text)..
|
|
|
|
|
|
First Thanks alot for ur reply..
<blockquote class="FQ"><div class="FQA">Abhijit Jana wrote:</div> thing you question is related to Asp.net !!! isnt it !!!</blockquote>
No this is windows based programming...
definitly it can be done easily in asp.net as u have given me the example..
but i am trying to do same in c#
like..
private void button1_Click(object sender, EventArgs e)
{
// here i have to retrive the text from text area on button click
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
so please help me out here in C#
i am knowing C++ well...( I GUESS ) but not c#
vikas da
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
{
string myStr = TextBox1.Text;
} Why don't you try it. TextBox1 is an object for class TextBox which has Text property returns the textbox content. I suggest you to get a book and workout the examples.
|
|
|
|