I have an 4 levels application but it works no enough quickly.
I tried to use OleDataReader, I put the next code on Data tier:
public OleDbDataReader GetDataQ() {
string sql;
sql = "SELECT * FROM MTABLE";
OleDbConnection dataConn = new OleDbConnection(MojaKonekcija);
OleDbDataReader dr;
dataConn.Open();
OleDbCommand myCommand = new OleDbCommand(sql, dataConn);
dr = myCommand.ExecuteReader();
rezultat.Close();
dr.Close();
dataConn.Close();
return dr;
}
I'd like to use "dr" and fill my DataGrid, but I've gor an error Data Reader
is closed.
What is a way reusing "dr" or to pass "dr" from one to another class?
On my client (odeBehind) I have:
OleDbDataReader rezultatVse = myList.GetDataQ();
but how to read them and hoe to bind to the DataGrid?
I would be helpfull if anybody has an example
I'm also surprised to hear that using a DataSet wasn't working fast enough
for you in this scenario. How big is MTable? Have you analyzed the indexes
on that table? That will gain you much more of a performance advantage than
simply switching from a DataSet to a DataReader. Also, are you truly using
a "Select *"? Is there a WHERE clause to your Sql statement?
Datagrid Girl
"zlata" <zl...@maop.si> wrote in message
news:O8Oy#JeHCHA.2572@tkmsftngp11...
<%@ Register TagPrefix="mintLab" Namespace="mintLab.webServerControls"
Assembly="mlcMenu" %>
<%@ Control Language="c#" %>
<tr><td>
<MINTLAB:CMENU id="CMenu1" runat="server" XmlDataFileName="MenuData.xml"
FontFamily="verdana" FontSize="8" FontBold="0" FontItalic="0"
TopMenuBGColor="FFFBF7" BGColor="FFFBF7" BGColorOver="B5BED6"
TopMenuBorderColor="636563" BorderColor="636563"
TopMenuFontColor="Black" FontColor="Black" TopMenuFontColorOver="Black"
FontColorOver="Black" MenuWidth="150" Left="1" Top="1"
SeparatorColor="FFFBF7" TopMenuIsHorizontal="true" IsHorizontal="false"
RightToLeft="false" DisplayOnClick="false"
TopMenuIsVariableWidth="false" IsVariableWidth="false"></MINTLAB:CMENU>
</td>
</tr>
Code behind:
..
ListeDB partnerMotnje = new ListeDB();
DataView rezultatVse = partnerMotnje.GetNamestitveVse(prefix,datum);
MojGrid.DataSource = rezultat;
MojGrid.DataBind();
..
Thank you for any help
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Then - do you closings.
--
David Wier
http://aspexpress.com
Home of ASP Express - the best ASP text editor in the Galaxy
First editor with ASP.Net features
"zlata" <zl...@maop.si> wrote in message
news:O8Oy#JeHCHA.2572@tkmsftngp11...