Click here to Skip to main content
15,916,280 members
Home / Discussions / C#
   

C#

 
GeneralRe: Query Access Database too slow! Why? Pin
Colin Angus Mackay15-Jan-07 12:57
Colin Angus Mackay15-Jan-07 12:57 
AnswerRe: Query Access Database too slow! Why? Pin
Aaron VanWieren15-Jan-07 13:24
Aaron VanWieren15-Jan-07 13:24 
GeneralRe: Query Access Database too slow! Why? Pin
Colin Angus Mackay15-Jan-07 13:46
Colin Angus Mackay15-Jan-07 13:46 
GeneralRe: Query Access Database too slow! Why? Pin
Aaron VanWieren16-Jan-07 2:09
Aaron VanWieren16-Jan-07 2:09 
GeneralRe: Query Access Database too slow! Why? Pin
deanpugh15-Jan-07 21:36
deanpugh15-Jan-07 21:36 
GeneralRe: Query Access Database too slow! Why? Pin
Aaron VanWieren16-Jan-07 2:13
Aaron VanWieren16-Jan-07 2:13 
GeneralRe: Query Access Database too slow! Why? Pin
deanpugh16-Jan-07 2:26
deanpugh16-Jan-07 2:26 
AnswerRe: Query Access Database too slow! Why? Pin
Aaron VanWieren16-Jan-07 4:29
Aaron VanWieren16-Jan-07 4:29 
Another question. Are you just reading the data from the database or are you altering the data? If you are just reading the data you could use the datareader which is much faster but only processes in a forward direction.

In regards to the select statement it is a method of the DataTable. The select statement takes an expression that is like value=1. Your code would look somehting like this:
DataTable dbsDataTable_= new DataTable("DT_Teams");
string strQuery = "SELECT * FROM t_DT_Teams;
string connectionstring = "YourConnectionString";

using(OleDbConnection connection = new OleDbConnection(connectionString)
{
     OleDbCommand dbsCommand = connection.CreateCommand();
     dbsCommand.CommandText = strQuery;

     OleDbDataAdapter dbsAdapter = new OleDbDataAdapter(dbsCommand);
     dbsAdapter.Fill(dbsDataTable);
}


From here you can work with the datatable and query the results:
DataRow[] result;
//Expresion similar to where clause
string expression= "column (= > <)value)";
result = dbsDataTable.Select(expression);

You then can work with the datarows with a foreach clause to process or retrieve your results. The best part of this is that you only access the database and get the data you want once, then you can select, sort, add columns and rows and compute your data disconnected from the database. The down side is that datatables are stored in memory.
Let me know if this works.
GeneralRe: Query Access Database too slow! Why? Pin
deanpugh16-Jan-07 4:39
deanpugh16-Jan-07 4:39 
GeneralRe: Query Access Database too slow! Why? Pin
Aaron VanWieren16-Jan-07 4:47
Aaron VanWieren16-Jan-07 4:47 
GeneralRe: Query Access Database too slow! Why? Pin
deanpugh16-Jan-07 4:51
deanpugh16-Jan-07 4:51 
GeneralRe: Query Access Database too slow! Why? Pin
deanpugh23-Jan-07 23:57
deanpugh23-Jan-07 23:57 
QuestionHow to create whiteboard for web application in .Net? Pin
pankaj_infogain15-Jan-07 5:45
pankaj_infogain15-Jan-07 5:45 
AnswerRe: How to create whiteboard for web application in .Net? Pin
Not Active15-Jan-07 6:11
mentorNot Active15-Jan-07 6:11 
Questionlabel problem Pin
groundzero11115-Jan-07 5:14
groundzero11115-Jan-07 5:14 
AnswerRe: label problem Pin
il_masacratore15-Jan-07 21:37
il_masacratore15-Jan-07 21:37 
GeneralRe: label problem Pin
groundzero11116-Jan-07 5:19
groundzero11116-Jan-07 5:19 
GeneralRe: label problem Pin
il_masacratore16-Jan-07 5:28
il_masacratore16-Jan-07 5:28 
GeneralRe: label problem Pin
groundzero11117-Jan-07 4:04
groundzero11117-Jan-07 4:04 
GeneralRe: label problem Pin
il_masacratore17-Jan-07 5:39
il_masacratore17-Jan-07 5:39 
Questionconnecting to webservice Pin
fmardani15-Jan-07 5:03
fmardani15-Jan-07 5:03 
QuestionPlease Guide Me Pin
Ashish Porwal15-Jan-07 5:01
Ashish Porwal15-Jan-07 5:01 
Questionc# application and ActiveX Pin
Gallo_Teo15-Jan-07 4:58
Gallo_Teo15-Jan-07 4:58 
QuestionHow to deploy a .Net dll in other machine Pin
GnanaprakashJebaraj15-Jan-07 4:31
GnanaprakashJebaraj15-Jan-07 4:31 
QuestionWindows services Pin
rodrigorodriquez15-Jan-07 4:01
rodrigorodriquez15-Jan-07 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.