|
Denver Thomas wrote: Image img=Image.FromFile(val)
I think Image.FromFile() won't release the file handle immediately. You may try to read the files from a stream and dispose stream after image loaded. It would be something like
Image img = null;
using (FileStream fs = new FileStream("imagePath", FileMode.Open))
{
img = Image.FromStream(fs);
}
|
|
|
|
|
hi friends....
thanks for your reply.I tried both the methods..but failed.
When i tried reading from stream...it is showing out of memmory exception.
I tried another method like take a clone of the original bitmap and dispose that one...but still that process is not releasing that image. Is there any other way to do that ?
|
|
|
|
|
Denver Thomas wrote: it is showing out of memmory exception.
What is your image size ? Is it too big ?
|
|
|
|
|
yes yes....it is 600*624 in size...any other way to do that ?
|
|
|
|
|
Denver Thomas wrote: 600*624 in size
This don't make any problem. I was asking for the file size.
|
|
|
|
|
Hi,
Image class returns some weird exceptions, OutOfMemory typically means image format not
supported, or "The file does not have a valid image format" (i.e. some data error in file).
It is not indicating a memory problem!
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
choose one implementation, show us the code and give us exact symptoms. Then we can
help and figure out what is going wrong.
BTW: is the image file you want to delete a recent file, i.e. did your app create it
as well, or is it a pre-existing image file?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
oh thank u friend....i didnt tried "embeddedcolormanagement" parameter of fromstream Method.... I think it will work ...
|
|
|
|
|
I have a settings form for my application (ex: default start time for a task is 8:00 AM, or background color of the app). Where do you think it's better to store these info?
1. app config
2. setting table in database
3. registry
|
|
|
|
|
|
It depends on your app in some ways. If you store in a database your settings are dependant on accessing the database - if its unavailable what would the impact be. The registry is a bad idea, that went out with the ark. Too many registry entries slow the computer, which hive do you put them in, maintenance is a pain etc.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yeah, it depends on how you want them to work.
If they are stored in a database, then the user can use his settings regardless of which computer he is at. (Some of my software is used in a call-center where a user may not get the same workstation each shift.)
They could also be stored in "C:\Documents and Settings\All Users\Application Data" so every user on the specific computer gets them.
Or in "C:\Documents and Settings\specific user\Application Data" so each user has his own set on that computer.
I don't use App.Config, but that's just me.
<Aside>
Won't the App.Config get overwritten during an update?
</Aside>
Oh, and the registry is evil.
|
|
|
|
|
OracleConnection con = new OracleConnection(strMyConnectionString);
con.Open();
OracleCommand oc = new OracleCommand(@"DESC MyTable",con); //oops, I forgot the table name
TextBox1.Text = oc.CommandText;
Of course this's not working and that's why I'm posting this. So can you please tell me how do you do it?? I mean retrieving the two columns that would result from the DESC command in Oracle Sql*Plus.
Thank you guys
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
modified on Monday, April 14, 2008 3:29 AM
|
|
|
|
|
Weird. DESC is standard SQL, it's not a command on it's own AFAIK. Did you try google ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
As Far As I Know
DESC is not a SQL command, it's a modifier.
select * from tbl order by Id
is the same as
select * from tbl order by Id ASC
and
select * from tbl order by Id DESC
makes the order descending.
What are you trying to do ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, but I dont mean descending sorting by DESC, I mean DESCribe
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Hey, thanks mate, that was some useful link
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi Christian, I found something but still need an example
SELECT
column_name "Name",
nullable "Null?",
concat(concat(concat(data_type,'('),data_length),')') "Type"
FROM user_tab_columns
WHERE table_name='TABLE_NAME_TO_DESCRIBE';
ps. The SQL DDL is not a valid SELECT statement so you would need to use an alternative.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
OK - now you just need to know how to run a SQL command against an oracle DB.
ADO.NET works the same as it does for SQL Server, you just build your SQL and execute it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: you just need to know how to run a SQL command against an oracle DB
Ok,
Christian Graus wrote: just build your SQL and execute it.
And.. .. I mean once I do it, how do I read the output??
Maybe by using the ExecuteReader() .. Ok, Dont worry, I'll handle it, Thanks Christian
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
string strDesc = @"SELECT concat(column_name,',') ""Name"" FROM user_tab_columns WHERE table_name='TEST'";
OracleCommand oc = new OracleCommand(strDesc, con);
adap = new OracleDataAdapter(oc);
OracleDataReader oraDataReader = oc.ExecuteReader();
string strTemp = String.Empty;
while (oraDataReader.Read())
strTemp += oraDataReader.GetString(0);
strTemp = strTemp.Substring(0, strTemp.Length - 1);
MessageBox.Show(strTemp);
Thanks to you Christian
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
modified on Monday, April 14, 2008 4:16 AM
|
|
|
|
|
Awesome - glad you got it working.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I have a DataGridView which has a column of type double. How can i set that this column cells to be validated without reference to the decimal separator("," or ".")? Because the cell is validated only when the decimal separator in the value is identical to which is set in the regional settings.
Thanks.
|
|
|
|