Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 8 Jul 2008 14:53:37 -0400,    group: microsoft.public.dotnet.languages.csharp        back       


slow fill   
I am experiencing slow response from my  fill command.
I am trying to open a database and one table and add data at some point.
Is there a way to just open the table without all the data being read in 
when using my fill on my dataadapter.
Is there a more efficient way to instantiate my dataadpter
Below is my code:

Thanks

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Common;
using System.Data.Odbc;
using System.Collections;
using System.IO;


namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            OdbcConnection dbconn = new
OdbcConnection("Provider=MSDASQL.1;DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=c:\\hedgefunds\\db1.mdb;DATABASE=db1;UID=root;PWD=;
OPTION=1;");
            dbconn.Open();
            OdbcDataAdapter dbrs = new OdbcDataAdapter("Select * From
MyTable;", dbconn);
            OdbcCommandBuilder builder = new OdbcCommandBuilder(dbrs);
            DataSet dbADOrs = new DataSet();

            InitializeComponent();
            dbrs.MissingSchemaAction = MissingSchemaAction.AddWithKey;
            dbrs.Fill(dbADOrs);
            OpenReturnFile(dbrs, dbADOrs);


        }
date: Tue, 8 Jul 2008 14:53:37 -0400   author:   D

Re: slow fill   
"D"  wrote in message 
news:8GOck.19964$LL4.9006@bignews7.bellsouth.net...
>I am experiencing slow response from my  fill command.
> I am trying to open a database and one table and add data at some point.
> Is there a way to just open the table without all the data being read in 
> when using my fill on my dataadapter.

    Use FillSchema instead of Fill.
    Or change the Select statement so that it has an "impossible" Where 
clause. This will not bring in any data, but it will not prevent you from 
adding new records.
date: Tue, 8 Jul 2008 21:55:22 +0200   author:   Alberto Poblacion

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us