|
This sounds like a disaster. You can iterate over the controls collection and find the control with a given name, or you can create a Dictionary of names to control references.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Where I think you are getting confused is the ToCharArray() method.
This is a method of the string class, and what it does is to return the string calling it as an array of characters. I does not convert an image into an array.
The fields currentImage and nextImage , that you are using are strings representing a name that you have assigned to an image. They do not point to the image in any way.
Look up, either in MSDN or Google, 'List<t>' or 'ArrayList' and learn how to create a list of images, or better, since that would take up a lot of memory, a list of file names.
Then use your imagePosition field to index into that list.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for the reply,
The currentImage and nextImage are supposed to be strings that represent the name of the current image and next respectively. Maybe I should use something like currentImageIndx and nextImageIndx to be clear next time.
Anyways, I am not trying to save or convert the images in any how. I just want to be able use the string or char_array value as the image name.
Sorry for any confusion.
|
|
|
|
|
I think that you are OK with just your existing index imagePosition . the thing is to use it to index into a list or array of some kind. You can still make the current and next names as you are doing, if you need to display those values somewhere, if not they are of no use.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Im using the split function to parse a text file. How do I detect the end of a line? I tried '\0' but it didnt work as chars cant be null.
|
|
|
|
|
How about Environment.NewLine ?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
You can use Environment.Newline as mav suggested, or why not simply use File.ReadAllLines to read the file into an array of strings?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a class that returns a dataset,
csServices GetDataServices = new csServices();
gvServices.DataSource = GetDataServices.ServicesDS;
gvServices.DataMember = "tbl_Services";
all im doing is reading data, dont need to update etc..
Although my dataset (ServicesDS) returns 1 table and 6 columns,
i dont need to show all the columns in my gridview(gvServices),
how can I only show the columns I specifiy ie "ID", "Name"?
Following on.. should I be ref to a dataset or datatable,
pros, cons?
thanks
|
|
|
|
|
You're not telling which GridView you're using, web control, WPF etc?
Anyway, most gridviews work in a way that if you don't add columns to it before you bind the data, all columns are added automatically. So you should create the necessary columns beforehand either in code or in designer.
|
|
|
|
|
|
If you're using DataGridView, then you could use for example DataGridViewColumnCollection.Add Method [^] to add desired column to the DataGridView before you bind the data (or add the columns in designer).
|
|
|
|
|
I use 2 methods
limit the columns selected from the database, this gets rid of useless columns
set the column. visible = false - this hides the columns that are required but do not need to be seen by the user (id column)
You can still access the data in a non visible column
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
I'm trying to retrieve the columns from an Oracle 9i database using OdbcConnection class's getSchema method. While I can retrieve the tables and views just fine with getSchema("tables"), everytime I call getSchema("columns") I get a System.FormatException with message "Input string was not in a correct format".
I've tried various combinations of the schema string, such as "Columns", "COLUMNS", etc.
Thanks in advance.
Reference: http://msdn.microsoft.com/en-us/library/cc668760.aspx[^]
|
|
|
|
|
The GetSchema functionality depends on the ODBC driver. Are you using Microsoft's Oracle ODBC driver and if not, could you test GetSchema using that driver?
|
|
|
|
|
I was unable to configure Microsoft's ODBC Oracle driver successfully with the database, so I'm using Oracle's 9i driver. Thanks for the reply.
|
|
|
|
|
|
Mika,
Thanks for your suggestion about the driver; getSchema("columns") works fine with the Oracle database after I configure the connection using Microsoft's Oracle driver instead of Oracle's 9i driver.
There is one concern, though--will the future versions of Oracle database continue to work with Microsoft's driver?
Lastly, I'm still curious as to why getSchema("Tables") works with Oracle's driver but not getSchema("Columns").
Thanks.
|
|
|
|
|
Sorry for the late answer!
stilz wrote: will the future versions of Oracle database continue to work with Microsoft's driver?
Usually the will for a version or two. But if you upgrade the Microsofts driver when a newer Oracle version comes out, it usually supports new features better. However there's no quarantee for this, but that has been the situation for more thatn 10 years.
stilz wrote: Lastly, I'm still curious as to why getSchema("Tables") works with Oracle's driver but not getSchema
I would guess that Oracle simply hasn't implemented that. I think their main priority is to get people to use native connections, either System.Data.Oracle.OracleConnection (Microsoft's version) or Oracle.DataAccess.OracleConnection (Oracle's version).
|
|
|
|
|
How can i hide tooltip on properties when they are displayed through propertygrid.
Thanks
|
|
|
|
|
Hi everyone!
I'm working on a project and i need to do what follows:
i have an array of strings,example:
house3
house2
green23
green.5
H6
H01
G19
G78
..and so on.
I have to extract only the recurrent strings: house,green,H,G.
Any idea about it? (the language is java but doesn't matter, i just need the idea!)
Thanks in advance,
Enrico.
Program your life ^^
|
|
|
|
|
Lots of them but this looks like homework.
I imagine the Vector class is somewhere in your near future and use of the contains method.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Hi,
this would be my attempt:
- strip all redundant characters from each string, probably every non-letter;
- optionally: normalize the casing, say convert all strings to lower-case;
- collect the strings in a List<string>, however before adding them, check whether the new string
is already present; if so you found a duplicate.
(you can improve on this by using a Dictionary which holds the string as a key, and the occurence
count as an int value).
BTW: why ask for an algorithm in a language oriented forum that does not match your language?
we do have a "Math and algorithms" forum.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:38 PM
|
|
|
|
|
Luc Pattyn wrote: BTW: why ask for an algorithm in a language oriented forum that does not match your language?
we do have a "Math and algorithms" forum.
Is not the forum called "Algorithms", I don't see "Math" there?
|
|
|
|
|
Ravadre wrote: Is not the forum called "Algorithms",
it has been called "Algorithms and Math", as well as "Math and algorithms" before.
However you are right, this week it is called "Algorithms".
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:38 PM
|
|
|
|
|
try using regular expressions....using remove method.. removing pattern[0-9]
the quieter u become more u hear
|
|
|
|