Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
AnswerRe: Why is my bitmap file smaller than it should be ? Pin
Christian Graus14-Jul-09 11:58
protectorChristian Graus14-Jul-09 11:58 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
Paul Carr14-Jul-09 12:11
Paul Carr14-Jul-09 12:11 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
Paul Carr14-Jul-09 12:13
Paul Carr14-Jul-09 12:13 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
Paul Carr14-Jul-09 12:17
Paul Carr14-Jul-09 12:17 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
harold aptroot14-Jul-09 12:20
harold aptroot14-Jul-09 12:20 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
harold aptroot14-Jul-09 12:19
harold aptroot14-Jul-09 12:19 
GeneralRe: Why is my bitmap file smaller than it should be ? Pin
Christian Graus14-Jul-09 15:17
protectorChristian Graus14-Jul-09 15:17 
Questionusing statements and IDisposable Pin
saxisa14-Jul-09 11:38
saxisa14-Jul-09 11:38 
I'm looking at some code like this (sorry for the formatting):

public static OracleDataReader GetDynamicQueryReader (
OracleConnection con,
string sql,
out string msg)
{

sql = Regex.Replace(sql, @"\s+", " ");
try
{
using(OracleCommand cmd = new OracleCommand(sql, con))
{
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
msg = "Successful";
return dr;
}
}
catch (Exception ex)
{
msg = ex.Message;
con.Close();
return null;
}
}

This little chunk (not mine) is called several thousand times, and from the profiler I am using it is the generation of a new OracleCommand object costing the most. And this object can have its parameters set after instantiation.

Normally I would make this a static, but since I am supposed to instantiate it with a using statement to deal with the disposal of unmanaged references, Im not sure I can. Can I? If I determine that there are no memory leaks with a profiler by creating and disposing some unmanaged reference, can I safely make this static? Or should I really just put up with the poor performance?
AnswerRe: using statements and IDisposable Pin
Christian Graus14-Jul-09 11:59
protectorChristian Graus14-Jul-09 11:59 
AnswerRe: using statements and IDisposable Pin
PIEBALDconsult14-Jul-09 17:09
mvePIEBALDconsult14-Jul-09 17:09 
Questionwork with webBrowser properties? Pin
mr.mohsen14-Jul-09 10:16
mr.mohsen14-Jul-09 10:16 
AnswerRe: work with webBrowser properties? Pin
Adam R Harris14-Jul-09 10:26
Adam R Harris14-Jul-09 10:26 
GeneralRe: work with webBrowser properties? Pin
mr.mohsen14-Jul-09 10:39
mr.mohsen14-Jul-09 10:39 
GeneralRe: work with webBrowser properties? Pin
Adam R Harris14-Jul-09 10:51
Adam R Harris14-Jul-09 10:51 
GeneralRe: work with webBrowser properties? Pin
mr.mohsen14-Jul-09 20:19
mr.mohsen14-Jul-09 20:19 
GeneralRe: work with webBrowser properties? Pin
Adam R Harris14-Jul-09 20:28
Adam R Harris14-Jul-09 20:28 
QuestionRegEx not finding matches ... but it should Pin
Adam R Harris14-Jul-09 9:46
Adam R Harris14-Jul-09 9:46 
AnswerRe: RegEx not finding matches ... but it should Pin
dan!sh 14-Jul-09 19:53
professional dan!sh 14-Jul-09 19:53 
GeneralRe: RegEx not finding matches ... but it should Pin
Adam R Harris14-Jul-09 19:59
Adam R Harris14-Jul-09 19:59 
GeneralRe: RegEx not finding matches ... but it should Pin
dan!sh 14-Jul-09 22:30
professional dan!sh 14-Jul-09 22:30 
GeneralRe: RegEx not finding matches ... but it should Pin
Adam R Harris15-Jul-09 7:36
Adam R Harris15-Jul-09 7:36 
GeneralRe: RegEx not finding matches ... but it should Pin
dan!sh 15-Jul-09 8:25
professional dan!sh 15-Jul-09 8:25 
GeneralRe: RegEx not finding matches ... but it should Pin
Gideon Engelberth16-Jul-09 4:25
Gideon Engelberth16-Jul-09 4:25 
AnswerRe: RegEx not finding matches ... but it should Pin
riced14-Jul-09 21:15
riced14-Jul-09 21:15 
GeneralRe: RegEx not finding matches ... but it should Pin
Adam R Harris14-Jul-09 21:54
Adam R Harris14-Jul-09 21:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.