Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
GeneralRe: Led UI CONTROL Pin
half-life6-Feb-08 8:27
half-life6-Feb-08 8:27 
GeneralRe: Led UI CONTROL Pin
Ravi Bhavnani6-Feb-08 9:06
professionalRavi Bhavnani6-Feb-08 9:06 
GeneralRe: Led UI CONTROL Pin
half-life6-Feb-08 9:15
half-life6-Feb-08 9:15 
Generalexcel factory update Pin
arkiboys6-Feb-08 5:31
arkiboys6-Feb-08 5:31 
GeneralRe: excel factory update Pin
Jimmanuel6-Feb-08 7:39
Jimmanuel6-Feb-08 7:39 
GeneralRe: excel factory update Pin
arkiboys6-Feb-08 21:22
arkiboys6-Feb-08 21:22 
GeneralRe: excel factory update [modified] Pin
Jimmanuel7-Feb-08 3:48
Jimmanuel7-Feb-08 3:48 
Generala little more constructive criticism . . . Pin
Jimmanuel7-Feb-08 7:48
Jimmanuel7-Feb-08 7:48 
that if block where you assign strSQL is pretty inefficient in itself. There are two basic conditions that are being tested:
1) strBid_Price_Best_Latest.Length > 0
2) strAsk_Price_Best_Latest.Length > 0
but each variable is compared with zero 4 different times using different operators. That whole block can be reduced to 3 comparisons (down from 8) with the use of else blocks:
if (strBid_Price_Best_Latest.Length > 0)
{
	if (strAsk_Price_Best_Latest.Length > 0)
	{
		strSQL = @"Update [Allbonds$] Set Bid_Price = '" + strBid_Price_Best_Latest + "', Ask_Price = '" + strAsk_Price_Best_Latest + "' WHERE Security_ID = " + strSecurity_ID;
	}
	else
	{
		strSQL = @"Update [Allbonds$] Set Bid_Price = '" + strBid_Price_Best_Latest + "', Ask_Price = 0 WHERE Security_ID = " + strSecurity_ID;
	}
}
else
{
	if (strAsk_Price_Best_Latest.Length > 0)
	{
		strSQL = @"Update [Allbonds$] Set Bid_Price = 0, Ask_Price = '" + strAsk_Price_Best_Latest + "' WHERE Security_ID = " + strSecurity_ID;
	}
	else
	{
		strSQL = @"Update [Allbonds$] Set Bid_Price = 0, Ask_Price = 0 WHERE Security_ID = " + strSecurity_ID;
	}
}


Also, if you have "System.Data.OleDb" hardcoded in your program, then why use a Factory method to get your DB connection? You could just use OleDbConnection and OleDbCommand objects instead . . .

In other news, I'm having a very slow day at work Wink | ;)



GeneralRe: a little more constructive criticism . . . Pin
arkiboys7-Feb-08 22:14
arkiboys7-Feb-08 22:14 
GeneralOracle too slow in .Net Pin
El'Cachubrey6-Feb-08 3:58
El'Cachubrey6-Feb-08 3:58 
JokeRe: Oracle too slow in .Net Pin
Not Active6-Feb-08 4:03
mentorNot Active6-Feb-08 4:03 
AnswerRe: Oracle too slow in .Net Pin
Guffa6-Feb-08 4:56
Guffa6-Feb-08 4:56 
GeneralRe: Oracle too slow in .Net Pin
El'Cachubrey6-Feb-08 7:55
El'Cachubrey6-Feb-08 7:55 
GeneralRe: Oracle too slow in .Net Pin
Guffa6-Feb-08 8:17
Guffa6-Feb-08 8:17 
GeneralRe: Oracle too slow in .Net Pin
Ennis Ray Lynch, Jr.6-Feb-08 7:34
Ennis Ray Lynch, Jr.6-Feb-08 7:34 
GeneralRe: Oracle too slow in .Net Pin
El'Cachubrey6-Feb-08 7:50
El'Cachubrey6-Feb-08 7:50 
AnswerRe: Oracle too slow in .Net Pin
Guffa6-Feb-08 8:10
Guffa6-Feb-08 8:10 
GeneralHtml to Pdf Pin
marky7776-Feb-08 3:46
marky7776-Feb-08 3:46 
GeneralRe: Html to Pdf Pin
sabrown1006-Feb-08 7:30
sabrown1006-Feb-08 7:30 
GeneralFTP check for existing files Pin
Dreamzor6-Feb-08 3:44
Dreamzor6-Feb-08 3:44 
GeneralRe: FTP check for existing files Pin
Not Active6-Feb-08 4:01
mentorNot Active6-Feb-08 4:01 
GeneralRe: FTP check for existing files Pin
Dreamzor6-Feb-08 4:21
Dreamzor6-Feb-08 4:21 
GeneralRe: FTP check for existing files Pin
Not Active6-Feb-08 4:35
mentorNot Active6-Feb-08 4:35 
GeneralRe: FTP check for existing files Pin
Dreamzor6-Feb-08 4:46
Dreamzor6-Feb-08 4:46 
GeneralRe: FTP check for existing files Pin
Not Active6-Feb-08 4:59
mentorNot Active6-Feb-08 4:59 

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.