|
Hello All,
I fill arraylist with some elements and i need to remove the duplicate elements for the arraylist. How Can i do that?
Thanks
hay
|
|
|
|
|
Wouldn't it be easier to check for duplicates on insertion?
You can do so by using the Contains method of the ArrayList.
/cadi
24 hours is not enough
|
|
|
|
|
Whats the "best" (most widley accepted) way to store user preferences in a way they can be read and written to?
I though of using .config and coding a way to write back to it .... but have since been told its bad programming practice to write to a .config.
May be the registry? but im using this program as a peice of portfolio work to show potential employers and im not sure they would want a slew of candidates code writing to somthing as volotile and not-so easily cleaned as the reg' .... or is this somthing they will expect?
|
|
|
|
|
IMO, the best way is whatever suits the requirements of the application. Do you want your users editing the config file themselves? Do you want the config information human-readable? Does your install program handle creating a registry entries? Are you installing your app as an "all-users" app and relying on Windows login to differentiate users, or does your app have a separate login? Is it a client-server app, where the user config might be on the server so the user gets his/her setting regardless of what client tmachine they are using?
It's more a question of requirements than the current fad. Hope that helps.
Marc
My website
Latest Articles:
Object Comparer
String Helpers
|
|
|
|
|
On the other hand, you don't want to analyse the problem to death and paralyze the whole project, so just use an ini file. The important thing is to abstract your option loading and saving, so that you can plug in the popular method of the day. Then, of course, you'll discover that the ini file format is just fine 99.9% of the time and there's no need for the overkill of registry, SQL, XML, etc.
Matt Gerrans
|
|
|
|
|
try using a Database. Hopefully thats the widely used approach (if not file IO)
Hope this helps!!!
Regards,
Sidhu
IF YOU DON'T HAVE ANYTHING TO SAY, WELCOME TO THE CLUB
Dotnet @ Work Where Dotnet works...
My Blog
|
|
|
|
|
I think you can use XML to store user's pref...
The man with nothing to lose
|
|
|
|
|
Take a look at the Configuration Application Block[^]. It's part of Microsoft's Enterprise Library. I used the Configuration Application Block in my last app. and it worked very well. Easy to implement, very flexible and a snap to set up and configure.
Cheers,
Drew.
|
|
|
|
|
Does anyone know how to do this conversion from pdf format to a tif format.
Thanks
|
|
|
|
|
Sure, there are three ways:
1) Use Photoshop to load the PDF and simply export it as a TIFF.
2) Use Ghostgum[^] in conjunction with Ghostscript and choose Convert from the file menu.
3) Use a third party PDF library (some of which are advertised here) or one of the free ones on SourceForge to render the PDF file to a bitmap and dump it to a file using .NET or other graphics library, several of which can be found here for free at the Code Project.
Cheers,
Drew.
|
|
|
|
|
here a prob..in the treeview control, when i right click on a node and say add,then i should be able to add a node immediately after that node ...
|
|
|
|
|
So what's the problem?
mav
|
|
|
|
|
how to trap the parent nodes, so tat whn i add a node at runtime, its added after the selected node
|
|
|
|
|
I guess I see what you want, although you should really describe in more detail what your problem is, so people wanting to help don't have to guess every detail...
You have a context menu on the TreeView and when you right-click the TreeView, the node you've clicked on seems to be selected, but the TreeView's SelectedNode property returns a different node, right?
If that's your problem, then add a popup event handler to your context menu and set the selected node yourself:
TreeNode nd = treeView1.GetNodeAt(treeView1.PointToClient(Cursor.Position));
if (nd != null)
treeView1.SelectedNode = nd; In the menuitem Click handler you can then simply write
treeView1.SelectedNode.Nodes.Add(new TreeNode("A new node")); Regards,
mav
|
|
|
|
|
Hi all
I am writting a C# program that reads lines from a file. And then store each line in one record in more than one field.
But at the middle of the proccessing a message said that "v\cant open more tables"
here is the pic:
http://www.javadevs.com/problem.bmp[^]
copy the link and paste it in the browser...
And here is my code:
for (int i = 1; i<= Int32.Parse(numNumber.Value.ToString().Trim()); i++ ) {
string cha = answers.Substring(i-1,1);
string anCommand = "UPDATE information SET " + i + "='" + cha + "' WHERE id = '" + id+ "';";
try
{
com = new OdbcCommand(anCommand, dbConn);
com.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show( anCommand + "\r\nInserting answers\r\n" + ex.ToString());
stsGrade.Text = "Error!...";
return;
}
finally
{
}
}
It worked for the first 3 lines, but in the fourth line the problem appeared!!
All the lines has the same structure.
I am using MS Access database.
What is the problem?
|
|
|
|
|
Perhaps calling Dispose on your OdbcCommand object after ExecuteNonQuery() will help...
mav
|
|
|
|
|
You are write
Thank u very much. I appreciated ur help
|
|
|
|
|
I hope for your sake no id is never 'DELETE FROM Information
|
|
|
|
|
I have read your Article Edit Almost Anything in a datagrid -Declan Brennan.
which is very interesting and a challenging work. My good wishes for your work.
I like to have in depth knowledge on it. Can you please help me?
I like do it in my project Address book for an Hospital in my hometown.
Traversing by Department Name and viewing patient Address in an datagrid.
Loading all patient Pictures and differentiating their disease using color box.
Profile
Name :Uma V
Qualification : M.c.a
Currently doing a DOT Net course and implementing a project in c#
Please give me your hand in making my project a success.
Regards,
Uma
UmaRamanan
|
|
|
|
|
UmaRamanan wrote:
I like to have in depth knowledge on it. Can you please help me?
That's a great article! However, if you want to understand the details, go into the debugger and see what it's doing, use MSDN and google search for info on classes and methods you don't understand.
To paraphrase, if someone explains it to you, you can program a a data grid. If you learn to explain it to yourself, you can program anything.
Marc
My website
Latest Articles:
Object Comparer
String Helpers
|
|
|
|
|
Hi Does anyone know how to generate a pdf(acrobat) from a standard text file?
|
|
|
|
|
There are no tools in the .net framework...
But you can find various components to generate pdf's in the internet. Or, if you don't want to generate your pdf inside a program, you can find "pdf printer"...for example PDF Ghost.
The pdf file format is an open file format, so you could implement your own pdf generator. References can be found in the internet too, for example here: http://partners.adobe.com/public/developer/pdf/index_reference.html#5
|
|
|
|
|
Hi everyone...
I wanna make dynamic form that controls can be added in runtime,
and also this form could be opened later, with the added controls.
Also I need to add source code for these added controls..
Thanks everyone...
Good coding...
|
|
|
|
|
hi!
You should read Marc Clifton's articles on declarative programming...
Regards,
mav
|
|
|
|
|