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

C#

 
GeneralLed UI CONTROL Pin
half-life6-Feb-08 5:44
half-life6-Feb-08 5:44 
GeneralRe: Led UI CONTROL Pin
led mike6-Feb-08 7:28
led mike6-Feb-08 7:28 
GeneralRe: Led UI CONTROL Pin
Brady Kelly6-Feb-08 7:45
Brady Kelly6-Feb-08 7:45 
GeneralRe: Led UI CONTROL Pin
half-life6-Feb-08 8:22
half-life6-Feb-08 8:22 
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 
Hi,
I am using the following codes to update an excel spreadsheet:

The problem is that I have to do this update for hundreds of records with different Security_IDs and it takes about 2 seconds per record to update. i.e. command.ExecuteNonQuery(); takes about 2 seconds for each update.

How can I modify this code to do all these updates quickly?

string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MarketAnalytics\YieldsSpreads\YieldsSpreads.xls;Extended Properties=""Excel 8.0;HDR=YES;""";

DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");

using (DbConnection connection = factory.CreateConnection())
{
connection.ConnectionString = connectionString;

using (DbCommand command = connection.CreateCommand())
{
command.CommandText = @"Update [Allbonds$] Set Bid_Price = '" + strBid_Price_Best_Latest + "', Ask_Price = '" + strAsk_Price_Best_Latest + "' WHERE Security_ID = " + strSecurity_ID;
command.CommandText = strSQL;
connection.Open();
command.ExecuteNonQuery();
}
}
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 
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 

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.