By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,670 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,670 IT Pros & Developers. It's quick & easy.

slow fill

P: n/a
D
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={Microso ft 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);
}
Jul 8 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"D" <d@bellsouth.netwrote in message
news:8G******************@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.

Jul 8 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.