User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 392,009 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,219 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 1419 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 17
Reputation: 1qaz2wsx7 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
1qaz2wsx7 1qaz2wsx7 is offline Offline
Newbie Poster

How to make it faster ? c# and dataBase

  #1  
Jul 29th, 2007
Hi

I have 3 DataGrids (and even more in the future) that supose to present data from a DataBase.
When i press on the main DG all the rest
are updated according to a cartein Code Index.

The problem is that its very slow and
i want to make it faster.


Im doing it like that:
1) When clicking on the main DG.
2) Code Index is taking from the DG.
3) a connection is created to a diffrent
table in the DataBase.
4)according to this Code Index, this
table is fitered using SQL string.
5)the dataSet is presented in a dataGrid.

Thos steps happend everytime i click
on a cell in the main DataGrid.


The problem is that this is slow
and i want to make it faster,
how can i do that ?


HERE IS THE CODE:

******************************************
 dataGridView2.DataSource = null;

 string CoString = @"Provider=PervasiveOLEDB;" + @"Data Source=Z:\index;";
string strSql2 = "SELECT description,street,number,settling FROM addresses WHERE code=" + code;

OleDbConnection con = new OleDbConnection(CoString);
con.Open();


// Addresses Table
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand(strSql2, con);
DataSet dataset2 = new DataSet();
adapter.Fill(dataset2, "addresses");

this.dataGridView2.DataSource = dataset2.Tables[0];

            this.dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader;
            this.dataGridView2.AutoResizeColumns();

//Close Connection
con.Close();
******************************************

Thanks.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Location: England, For Now.
Posts: 163
Reputation: RwCC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 3
RwCC's Avatar
RwCC RwCC is offline Offline
Junior Poster

Re: How to make it faster ? c# and dataBase

  #2  
Aug 2nd, 2007
Are you preforming the jobs one at a time? One way to make everything faster is to build a list first instead of doing them one at a time
Sir David Healy - Northern Ireland Goal King
Reply With Quote  
Join Date: Oct 2007
Posts: 92
Reputation: Jugortha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 8
Jugortha Jugortha is offline Offline
Junior Poster in Training

Re: How to make it faster ? c# and dataBase

  #3  
Dec 23rd, 2007
I propose for u a solution, may be that get your application faster
use the tool negen.exe of the dotnet framework it creates a native image of your exe assembly in aspecified files and install them in the native image cache of the computer and that avoid the JIT compile your exe assembly each time u use the application
to do this
click on start -> Microsoft.Net Framework SDK v2.0 -> SDK command prompt
the tape
negen install exefilepath.exe
and then press enter
try this proposal
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 10:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC