vstudio data access problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wesley Peace

    vstudio data access problems

    I hate to cross post, but I've gotten no answer yet on a problem I'm having
    with visual studio 2008.

    I've created a series of forms with controls to access a Access database
    tables. The connection string works fine and the tables are added to the
    project without a problem.

    When I create the tables they appear to bind and I am able to preview the
    data in the database in design mode; however, at runtime no data is
    displayed and the dataviewgrids don't allow me to update the tables.

    I'm currently using C#, but have tried the same application in Visual Basic
    with the same results.

    I've also tried re-creating the application (at least one of the windows
    forms) on a different computer with the same results. Not able to display
    the access tables.. As well as with SSCE as the data source.

    I've checked MSDN and stepped through the Walkthroughs with no success.

    Has anyone else seen this problem or provide me some guidance.

  • Alvin Bruney [ASP.NET MVP]

    #2
    Re: vstudio data access problems

    Post your code with sample data.

    --
    Regards,
    Alvin Bruney

    Want a free copy of VS 2008 w/ MSDN premium subscription?
    Details at http://msmvps.com/blogs/alvin/Default.aspx

    Auther Plug
    OWC Blackbook now on download at www.lulu.com/owc

    "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
    news:Oqo$bb6KJH A.1160@TK2MSFTN GP05.phx.gbl...
    I hate to cross post, but I've gotten no answer yet on a problem I'm
    having with visual studio 2008.
    >
    I've created a series of forms with controls to access a Access database
    tables. The connection string works fine and the tables are added to the
    project without a problem.
    >
    When I create the tables they appear to bind and I am able to preview the
    data in the database in design mode; however, at runtime no data is
    displayed and the dataviewgrids don't allow me to update the tables.
    >
    I'm currently using C#, but have tried the same application in Visual
    Basic with the same results.
    >
    I've also tried re-creating the application (at least one of the windows
    forms) on a different computer with the same results. Not able to display
    the access tables.. As well as with SSCE as the data source.
    >
    I've checked MSDN and stepped through the Walkthroughs with no success.
    >
    Has anyone else seen this problem or provide me some guidance.

    Comment

    • Wesley Peace

      #3
      Re: vstudio data access problems

      Thanks.


      ===frmMain.cs

      using System;
      using System.Collecti ons.Generic;
      using System.Componen tModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Windows. Forms;

      namespace ACRMS
      {
      public partial class frmMain : Form
      {
      public frmMain()
      {
      InitializeCompo nent();
      }

      private void miFileClose_Cli ck(object sender, EventArgs e)
      {
      Close();
      }

      private void miFormsRegister _Click(object sender, EventArgs e)
      {
      // frmRegister Registration = new frmRegister();
      frmRegistration Registration = new frmRegistration ();
      Registration.Md iParent = this;
      Registration.Sh ow();

      }

      private void miFormsClubs_Cl ick(object sender, EventArgs e)
      {
      frmClubs Clubs = new frmClubs();
      Clubs.MdiParent = this;
      Clubs.Show();
      }

      private void miFormsLedger_C lick(object sender, EventArgs e)
      {
      frmLedger Ledger = new frmLedger(); ;
      Ledger.MdiParen t = this;
      Ledger.Show();
      }
      }
      }

      ====frmLedger.c s

      sing System;
      using System.Collecti ons.Generic;
      using System.Componen tModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Windows. Forms;

      namespace ACRMS
      {
      public partial class frmLedger : Form
      {
      public frmLedger()
      {
      InitializeCompo nent();
      }

      private void frmLedger_Load( object sender, EventArgs e)
      {
      // TODO: This line of code loads data into the
      'awanaDataSet.L edger' table. You can move, or remove it, as needed.
      this.LedgerTA.F ill(this.awanaD ataSet.Ledger);

      }
      }
      }

      ===>frmLedger.D esigner.cs
      namespace ACRMS
      {
      partial class frmLedger
      {
      /// <summary>
      /// Required designer variable.
      /// </summary>
      private System.Componen tModel.IContain er components = null;

      /// <summary>
      /// Clean up any resources being used.
      /// </summary>
      /// <param name="disposing ">true if managed resources should be
      disposed; otherwise, false.</param>
      protected override void Dispose(bool disposing)
      {
      if (disposing && (components != null))
      {
      components.Disp ose();
      }
      base.Dispose(di sposing);
      }

      #region Windows Form Designer generated code

      /// <summary>
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// </summary>
      private void InitializeCompo nent()
      {
      this.components = new System.Componen tModel.Containe r();
      System.Windows. Forms.DataGridV iewCellStyle
      dataGridViewCel lStyle1 = new System.Windows. Forms.DataGridV iewCellStyle();
      System.Windows. Forms.DataGridV iewCellStyle
      dataGridViewCel lStyle2 = new System.Windows. Forms.DataGridV iewCellStyle();
      System.Windows. Forms.DataGridV iewCellStyle
      dataGridViewCel lStyle3 = new System.Windows. Forms.DataGridV iewCellStyle();
      System.Windows. Forms.DataGridV iewCellStyle
      dataGridViewCel lStyle4 = new System.Windows. Forms.DataGridV iewCellStyle();
      System.Componen tModel.Componen tResourceManage r resources = new
      System.Componen tModel.Componen tResourceManage r(typeof(frmLed ger));
      this.statLedger = new System.Windows. Forms.StatusStr ip();
      this.dgvLedger = new System.Windows. Forms.DataGridV iew();
      this.awanaDataS et = new ACRMS.AwanaData Set();
      this.LedgerBS = new
      System.Windows. Forms.BindingSo urce(this.compo nents);
      this.LedgerTA = new
      ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter();
      this.iDDataGrid ViewTextBoxColu mn = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.aDateDataG ridViewTextBoxC olumn = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.descriptio nDataGridViewTe xtBoxColumn = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.debitDataG ridViewTextBoxC olumn = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.creditData GridViewTextBox Column = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.Balance = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      this.commentsDa taGridViewTextB oxColumn = new
      System.Windows. Forms.DataGridV iewTextBoxColum n();
      ((System.Compon entModel.ISuppo rtInitialize)(t his.dgvLedger)) .BeginInit();
      ((System.Compon entModel.ISuppo rtInitialize)(t his.awanaDataSe t)).BeginInit() ;
      ((System.Compon entModel.ISuppo rtInitialize)(t his.LedgerBS)). BeginInit();
      this.SuspendLay out();
      //
      // statLedger
      //
      this.statLedger .Location = new System.Drawing. Point(0, 177);
      this.statLedger .Name = "statLedger ";
      this.statLedger .Size = new System.Drawing. Size(488, 22);
      this.statLedger .TabIndex = 0;
      this.statLedger .Text = "statusStri p1";
      //
      // dgvLedger
      //
      this.dgvLedger. AutoGenerateCol umns = false;
      this.dgvLedger. ColumnHeadersHe ightSizeMode =
      System.Windows. Forms.DataGridV iewColumnHeader sHeightSizeMode .AutoSize;
      this.dgvLedger. Columns.AddRang e(new
      System.Windows. Forms.DataGridV iewColumn[] {
      this.iDDataGrid ViewTextBoxColu mn,
      this.aDateDataG ridViewTextBoxC olumn,
      this.descriptio nDataGridViewTe xtBoxColumn,
      this.debitDataG ridViewTextBoxC olumn,
      this.creditData GridViewTextBox Column,
      this.Balance,
      this.commentsDa taGridViewTextB oxColumn});
      this.dgvLedger. DataSource = this.LedgerBS;
      this.dgvLedger. Dock = System.Windows. Forms.DockStyle .Fill;
      this.dgvLedger. Location = new System.Drawing. Point(0, 0);
      this.dgvLedger. Name = "dgvLedger" ;
      this.dgvLedger. Size = new System.Drawing. Size(488, 177);
      this.dgvLedger. TabIndex = 1;
      //
      // awanaDataSet
      //
      this.awanaDataS et.DataSetName = "AwanaDataS et";
      this.awanaDataS et.SchemaSerial izationMode =
      System.Data.Sch emaSerializatio nMode.IncludeSc hema;
      //
      // LedgerBS
      //
      this.LedgerBS.D ataMember = "Ledger";
      this.LedgerBS.D ataSource = this.awanaDataS et;
      //
      // LedgerTA
      //
      this.LedgerTA.C learBeforeFill = true;
      //
      // iDDataGridViewT extBoxColumn
      //
      this.iDDataGrid ViewTextBoxColu mn.DataProperty Name = "ID";
      this.iDDataGrid ViewTextBoxColu mn.HeaderText = "ID";
      this.iDDataGrid ViewTextBoxColu mn.Name =
      "iDDataGridView TextBoxColumn";
      this.iDDataGrid ViewTextBoxColu mn.Visible = false;
      //
      // aDateDataGridVi ewTextBoxColumn
      //
      this.aDateDataG ridViewTextBoxC olumn.DataPrope rtyName = "ADate";
      dataGridViewCel lStyle1.Format = "d";
      dataGridViewCel lStyle1.NullVal ue = null;
      this.aDateDataG ridViewTextBoxC olumn.DefaultCe llStyle =
      dataGridViewCel lStyle1;
      this.aDateDataG ridViewTextBoxC olumn.HeaderTex t = "Date";
      this.aDateDataG ridViewTextBoxC olumn.Name =
      "aDateDataGridV iewTextBoxColum n";
      this.aDateDataG ridViewTextBoxC olumn.Width = 75;
      //
      // descriptionData GridViewTextBox Column
      //
      this.descriptio nDataGridViewTe xtBoxColumn.Dat aPropertyName =
      "Descriptio n";
      this.descriptio nDataGridViewTe xtBoxColumn.Hea derText =
      "Descriptio n";
      this.descriptio nDataGridViewTe xtBoxColumn.Nam e =
      "descriptionDat aGridViewTextBo xColumn";
      this.descriptio nDataGridViewTe xtBoxColumn.Wid th = 150;
      //
      // debitDataGridVi ewTextBoxColumn
      //
      this.debitDataG ridViewTextBoxC olumn.DataPrope rtyName = "Debit";
      dataGridViewCel lStyle2.Alignme nt =
      System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
      dataGridViewCel lStyle2.Format = "N2";
      dataGridViewCel lStyle2.NullVal ue = "0";
      this.debitDataG ridViewTextBoxC olumn.DefaultCe llStyle =
      dataGridViewCel lStyle2;
      this.debitDataG ridViewTextBoxC olumn.HeaderTex t = "Debit";
      this.debitDataG ridViewTextBoxC olumn.Name =
      "debitDataGridV iewTextBoxColum n";
      this.debitDataG ridViewTextBoxC olumn.Resizable =
      System.Windows. Forms.DataGridV iewTriState.Fal se;
      this.debitDataG ridViewTextBoxC olumn.Width = 60;
      //
      // creditDataGridV iewTextBoxColum n
      //
      this.creditData GridViewTextBox Column.DataProp ertyName =
      "Credit";
      dataGridViewCel lStyle3.Alignme nt =
      System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
      dataGridViewCel lStyle3.Format = "N2";
      dataGridViewCel lStyle3.NullVal ue = "0";
      this.creditData GridViewTextBox Column.DefaultC ellStyle =
      dataGridViewCel lStyle3;
      this.creditData GridViewTextBox Column.HeaderTe xt = "Credit";
      this.creditData GridViewTextBox Column.Name =
      "creditDataGrid ViewTextBoxColu mn";
      this.creditData GridViewTextBox Column.Width = 60;
      //
      // Balance
      //
      dataGridViewCel lStyle4.Alignme nt =
      System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
      dataGridViewCel lStyle4.Format = "N2";
      dataGridViewCel lStyle4.NullVal ue = "0";
      this.Balance.De faultCellStyle = dataGridViewCel lStyle4;
      this.Balance.He aderText = "Balance";
      this.Balance.Na me = "Balance";
      //
      // commentsDataGri dViewTextBoxCol umn
      //
      this.commentsDa taGridViewTextB oxColumn.DataPr opertyName =
      "Comments";
      this.commentsDa taGridViewTextB oxColumn.Header Text = "Comments";
      this.commentsDa taGridViewTextB oxColumn.Name =
      "commentsDataGr idViewTextBoxCo lumn";
      this.commentsDa taGridViewTextB oxColumn.Visibl e = false;
      this.commentsDa taGridViewTextB oxColumn.Width = 250;
      //
      // frmLedger
      //
      this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
      this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
      this.ClientSize = new System.Drawing. Size(488, 199);
      this.Controls.A dd(this.dgvLedg er);
      this.Controls.A dd(this.statLed ger);
      this.FormBorder Style =
      System.Windows. Forms.FormBorde rStyle.FixedDia log;
      this.Icon =
      ((System.Drawin g.Icon)(resourc es.GetObject("$ this.Icon")));
      this.MaximizeBo x = false;
      this.Name = "frmLedger" ;
      this.Text = "Ledger";
      this.Load += new System.EventHan dler(this.frmLe dger_Load);
      ((System.Compon entModel.ISuppo rtInitialize)(t his.dgvLedger)) .EndInit();
      ((System.Compon entModel.ISuppo rtInitialize)(t his.awanaDataSe t)).EndInit();
      ((System.Compon entModel.ISuppo rtInitialize)(t his.LedgerBS)). EndInit();
      this.ResumeLayo ut(false);
      this.PerformLay out();

      }

      #endregion

      private System.Windows. Forms.StatusStr ip statLedger;
      private System.Windows. Forms.DataGridV iew dgvLedger;
      private AwanaDataSet awanaDataSet;
      private System.Windows. Forms.BindingSo urce LedgerBS;
      private ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter LedgerTA;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      iDDataGridViewT extBoxColumn;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      aDateDataGridVi ewTextBoxColumn ;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      descriptionData GridViewTextBox Column;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      debitDataGridVi ewTextBoxColumn ;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      creditDataGridV iewTextBoxColum n;
      private System.Windows. Forms.DataGridV iewTextBoxColum n Balance;
      private System.Windows. Forms.DataGridV iewTextBoxColum n
      commentsDataGri dViewTextBoxCol umn;
      }
      }

      I've had this minimal code load the table in prior versions of both VB as
      well as C#. At this stage I've done no more than insure the table is
      correctly loaded before proceeding further. One record exists in this table
      and it is not loaded. The bindingNav is actually greyed out and record count
      is 0.

      This is the data in the table to be loaded.

      "ID","ADate","D escription","De bit","Credit"," Comments"
      1,10/3/2008 0:00:00,"Dues", $67.00,$0.00,


      "Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote in
      message news:26CAF77B-3A19-4A58-A119-2A454C528528@mi crosoft.com...
      Post your code with sample data.
      >
      --
      Regards,
      Alvin Bruney
      >
      Want a free copy of VS 2008 w/ MSDN premium subscription?
      Details at http://msmvps.com/blogs/alvin/Default.aspx
      >
      Auther Plug
      OWC Blackbook now on download at www.lulu.com/owc
      >
      "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
      news:Oqo$bb6KJH A.1160@TK2MSFTN GP05.phx.gbl...
      >I hate to cross post, but I've gotten no answer yet on a problem I'm
      >having with visual studio 2008.
      >>
      >I've created a series of forms with controls to access a Access database
      >tables. The connection string works fine and the tables are added to the
      >project without a problem.
      >>
      >When I create the tables they appear to bind and I am able to preview the
      >data in the database in design mode; however, at runtime no data is
      >displayed and the dataviewgrids don't allow me to update the tables.
      >>
      >I'm currently using C#, but have tried the same application in Visual
      >Basic with the same results.
      >>
      >I've also tried re-creating the application (at least one of the windows
      >forms) on a different computer with the same results. Not able to display
      >the access tables.. As well as with SSCE as the data source.
      >>
      >I've checked MSDN and stepped through the Walkthroughs with no success.
      >>
      >Has anyone else seen this problem or provide me some guidance.
      >

      Comment

      • Alvin Bruney [ASP.NET MVP]

        #4
        Re: vstudio data access problems

        Your code does not compile. Did you review this link? I'm calling in Jon to
        yell at you.
        Review the instructions here.


        --
        Regards,
        Alvin Bruney

        Want a free copy of VS 2008 w/ MSDN premium subscription?
        Details at http://msmvps.com/blogs/alvin/Default.aspx

        Auther Plug
        OWC Blackbook now on download at www.lulu.com/owc

        "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
        news:e8$1x#8KJH A.1500@TK2MSFTN GP06.phx.gbl...
        Thanks.
        >
        >
        ===frmMain.cs
        >
        using System;
        using System.Collecti ons.Generic;
        using System.Componen tModel;
        using System.Data;
        using System.Drawing;
        using System.Linq;
        using System.Text;
        using System.Windows. Forms;
        >
        namespace ACRMS
        {
        public partial class frmMain : Form
        {
        public frmMain()
        {
        InitializeCompo nent();
        }
        >
        private void miFileClose_Cli ck(object sender, EventArgs e)
        {
        Close();
        }
        >
        private void miFormsRegister _Click(object sender, EventArgs e)
        {
        // frmRegister Registration = new frmRegister();
        frmRegistration Registration = new frmRegistration ();
        Registration.Md iParent = this;
        Registration.Sh ow();
        >
        }
        >
        private void miFormsClubs_Cl ick(object sender, EventArgs e)
        {
        frmClubs Clubs = new frmClubs();
        Clubs.MdiParent = this;
        Clubs.Show();
        }
        >
        private void miFormsLedger_C lick(object sender, EventArgs e)
        {
        frmLedger Ledger = new frmLedger(); ;
        Ledger.MdiParen t = this;
        Ledger.Show();
        }
        }
        }
        >
        ====frmLedger.c s
        >
        sing System;
        using System.Collecti ons.Generic;
        using System.Componen tModel;
        using System.Data;
        using System.Drawing;
        using System.Linq;
        using System.Text;
        using System.Windows. Forms;
        >
        namespace ACRMS
        {
        public partial class frmLedger : Form
        {
        public frmLedger()
        {
        InitializeCompo nent();
        }
        >
        private void frmLedger_Load( object sender, EventArgs e)
        {
        // TODO: This line of code loads data into the
        'awanaDataSet.L edger' table. You can move, or remove it, as needed.
        this.LedgerTA.F ill(this.awanaD ataSet.Ledger);
        >
        }
        }
        }
        >
        ===>frmLedger.D esigner.cs
        namespace ACRMS
        {
        partial class frmLedger
        {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.Componen tModel.IContain er components = null;
        >
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing ">true if managed resources should be
        disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
        if (disposing && (components != null))
        {
        components.Disp ose();
        }
        base.Dispose(di sposing);
        }
        >
        #region Windows Form Designer generated code
        >
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeCompo nent()
        {
        this.components = new System.Componen tModel.Containe r();
        System.Windows. Forms.DataGridV iewCellStyle
        dataGridViewCel lStyle1 = new System.Windows. Forms.DataGridV iewCellStyle();
        System.Windows. Forms.DataGridV iewCellStyle
        dataGridViewCel lStyle2 = new System.Windows. Forms.DataGridV iewCellStyle();
        System.Windows. Forms.DataGridV iewCellStyle
        dataGridViewCel lStyle3 = new System.Windows. Forms.DataGridV iewCellStyle();
        System.Windows. Forms.DataGridV iewCellStyle
        dataGridViewCel lStyle4 = new System.Windows. Forms.DataGridV iewCellStyle();
        System.Componen tModel.Componen tResourceManage r resources = new
        System.Componen tModel.Componen tResourceManage r(typeof(frmLed ger));
        this.statLedger = new System.Windows. Forms.StatusStr ip();
        this.dgvLedger = new System.Windows. Forms.DataGridV iew();
        this.awanaDataS et = new ACRMS.AwanaData Set();
        this.LedgerBS = new
        System.Windows. Forms.BindingSo urce(this.compo nents);
        this.LedgerTA = new
        ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter();
        this.iDDataGrid ViewTextBoxColu mn = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.aDateDataG ridViewTextBoxC olumn = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.descriptio nDataGridViewTe xtBoxColumn = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.debitDataG ridViewTextBoxC olumn = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.creditData GridViewTextBox Column = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.Balance = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        this.commentsDa taGridViewTextB oxColumn = new
        System.Windows. Forms.DataGridV iewTextBoxColum n();
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.dgvLedger)) .BeginInit();
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.awanaDataSe t)).BeginInit() ;
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.LedgerBS)). BeginInit();
        this.SuspendLay out();
        //
        // statLedger
        //
        this.statLedger .Location = new System.Drawing. Point(0, 177);
        this.statLedger .Name = "statLedger ";
        this.statLedger .Size = new System.Drawing. Size(488, 22);
        this.statLedger .TabIndex = 0;
        this.statLedger .Text = "statusStri p1";
        //
        // dgvLedger
        //
        this.dgvLedger. AutoGenerateCol umns = false;
        this.dgvLedger. ColumnHeadersHe ightSizeMode =
        System.Windows. Forms.DataGridV iewColumnHeader sHeightSizeMode .AutoSize;
        this.dgvLedger. Columns.AddRang e(new
        System.Windows. Forms.DataGridV iewColumn[] {
        this.iDDataGrid ViewTextBoxColu mn,
        this.aDateDataG ridViewTextBoxC olumn,
        this.descriptio nDataGridViewTe xtBoxColumn,
        this.debitDataG ridViewTextBoxC olumn,
        this.creditData GridViewTextBox Column,
        this.Balance,
        this.commentsDa taGridViewTextB oxColumn});
        this.dgvLedger. DataSource = this.LedgerBS;
        this.dgvLedger. Dock = System.Windows. Forms.DockStyle .Fill;
        this.dgvLedger. Location = new System.Drawing. Point(0, 0);
        this.dgvLedger. Name = "dgvLedger" ;
        this.dgvLedger. Size = new System.Drawing. Size(488, 177);
        this.dgvLedger. TabIndex = 1;
        //
        // awanaDataSet
        //
        this.awanaDataS et.DataSetName = "AwanaDataS et";
        this.awanaDataS et.SchemaSerial izationMode =
        System.Data.Sch emaSerializatio nMode.IncludeSc hema;
        //
        // LedgerBS
        //
        this.LedgerBS.D ataMember = "Ledger";
        this.LedgerBS.D ataSource = this.awanaDataS et;
        //
        // LedgerTA
        //
        this.LedgerTA.C learBeforeFill = true;
        //
        // iDDataGridViewT extBoxColumn
        //
        this.iDDataGrid ViewTextBoxColu mn.DataProperty Name = "ID";
        this.iDDataGrid ViewTextBoxColu mn.HeaderText = "ID";
        this.iDDataGrid ViewTextBoxColu mn.Name =
        "iDDataGridView TextBoxColumn";
        this.iDDataGrid ViewTextBoxColu mn.Visible = false;
        //
        // aDateDataGridVi ewTextBoxColumn
        //
        this.aDateDataG ridViewTextBoxC olumn.DataPrope rtyName = "ADate";
        dataGridViewCel lStyle1.Format = "d";
        dataGridViewCel lStyle1.NullVal ue = null;
        this.aDateDataG ridViewTextBoxC olumn.DefaultCe llStyle =
        dataGridViewCel lStyle1;
        this.aDateDataG ridViewTextBoxC olumn.HeaderTex t = "Date";
        this.aDateDataG ridViewTextBoxC olumn.Name =
        "aDateDataGridV iewTextBoxColum n";
        this.aDateDataG ridViewTextBoxC olumn.Width = 75;
        //
        // descriptionData GridViewTextBox Column
        //
        this.descriptio nDataGridViewTe xtBoxColumn.Dat aPropertyName =
        "Descriptio n";
        this.descriptio nDataGridViewTe xtBoxColumn.Hea derText =
        "Descriptio n";
        this.descriptio nDataGridViewTe xtBoxColumn.Nam e =
        "descriptionDat aGridViewTextBo xColumn";
        this.descriptio nDataGridViewTe xtBoxColumn.Wid th = 150;
        //
        // debitDataGridVi ewTextBoxColumn
        //
        this.debitDataG ridViewTextBoxC olumn.DataPrope rtyName = "Debit";
        dataGridViewCel lStyle2.Alignme nt =
        System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
        dataGridViewCel lStyle2.Format = "N2";
        dataGridViewCel lStyle2.NullVal ue = "0";
        this.debitDataG ridViewTextBoxC olumn.DefaultCe llStyle =
        dataGridViewCel lStyle2;
        this.debitDataG ridViewTextBoxC olumn.HeaderTex t = "Debit";
        this.debitDataG ridViewTextBoxC olumn.Name =
        "debitDataGridV iewTextBoxColum n";
        this.debitDataG ridViewTextBoxC olumn.Resizable =
        System.Windows. Forms.DataGridV iewTriState.Fal se;
        this.debitDataG ridViewTextBoxC olumn.Width = 60;
        //
        // creditDataGridV iewTextBoxColum n
        //
        this.creditData GridViewTextBox Column.DataProp ertyName =
        "Credit";
        dataGridViewCel lStyle3.Alignme nt =
        System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
        dataGridViewCel lStyle3.Format = "N2";
        dataGridViewCel lStyle3.NullVal ue = "0";
        this.creditData GridViewTextBox Column.DefaultC ellStyle =
        dataGridViewCel lStyle3;
        this.creditData GridViewTextBox Column.HeaderTe xt = "Credit";
        this.creditData GridViewTextBox Column.Name =
        "creditDataGrid ViewTextBoxColu mn";
        this.creditData GridViewTextBox Column.Width = 60;
        //
        // Balance
        //
        dataGridViewCel lStyle4.Alignme nt =
        System.Windows. Forms.DataGridV iewContentAlign ment.MiddleRigh t;
        dataGridViewCel lStyle4.Format = "N2";
        dataGridViewCel lStyle4.NullVal ue = "0";
        this.Balance.De faultCellStyle = dataGridViewCel lStyle4;
        this.Balance.He aderText = "Balance";
        this.Balance.Na me = "Balance";
        //
        // commentsDataGri dViewTextBoxCol umn
        //
        this.commentsDa taGridViewTextB oxColumn.DataPr opertyName =
        "Comments";
        this.commentsDa taGridViewTextB oxColumn.Header Text = "Comments";
        this.commentsDa taGridViewTextB oxColumn.Name =
        "commentsDataGr idViewTextBoxCo lumn";
        this.commentsDa taGridViewTextB oxColumn.Visibl e = false;
        this.commentsDa taGridViewTextB oxColumn.Width = 250;
        //
        // frmLedger
        //
        this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
        this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
        this.ClientSize = new System.Drawing. Size(488, 199);
        this.Controls.A dd(this.dgvLedg er);
        this.Controls.A dd(this.statLed ger);
        this.FormBorder Style =
        System.Windows. Forms.FormBorde rStyle.FixedDia log;
        this.Icon =
        ((System.Drawin g.Icon)(resourc es.GetObject("$ this.Icon")));
        this.MaximizeBo x = false;
        this.Name = "frmLedger" ;
        this.Text = "Ledger";
        this.Load += new System.EventHan dler(this.frmLe dger_Load);
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.dgvLedger)) .EndInit();
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.awanaDataSe t)).EndInit();
        >
        ((System.Compon entModel.ISuppo rtInitialize)(t his.LedgerBS)). EndInit();
        this.ResumeLayo ut(false);
        this.PerformLay out();
        >
        }
        >
        #endregion
        >
        private System.Windows. Forms.StatusStr ip statLedger;
        private System.Windows. Forms.DataGridV iew dgvLedger;
        private AwanaDataSet awanaDataSet;
        private System.Windows. Forms.BindingSo urce LedgerBS;
        private ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter
        LedgerTA;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        iDDataGridViewT extBoxColumn;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        aDateDataGridVi ewTextBoxColumn ;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        descriptionData GridViewTextBox Column;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        debitDataGridVi ewTextBoxColumn ;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        creditDataGridV iewTextBoxColum n;
        private System.Windows. Forms.DataGridV iewTextBoxColum n Balance;
        private System.Windows. Forms.DataGridV iewTextBoxColum n
        commentsDataGri dViewTextBoxCol umn;
        }
        }
        >
        I've had this minimal code load the table in prior versions of both VB as
        well as C#. At this stage I've done no more than insure the table is
        correctly loaded before proceeding further. One record exists in this
        table
        and it is not loaded. The bindingNav is actually greyed out and record
        count
        is 0.
        >
        This is the data in the table to be loaded.
        >
        "ID","ADate","D escription","De bit","Credit"," Comments"
        1,10/3/2008 0:00:00,"Dues", $67.00,$0.00,
        >
        >
        "Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote in
        message news:26CAF77B-3A19-4A58-A119-2A454C528528@mi crosoft.com...
        >Post your code with sample data.
        >>
        >--
        >Regards,
        >Alvin Bruney
        >>
        >Want a free copy of VS 2008 w/ MSDN premium subscription?
        >Details at http://msmvps.com/blogs/alvin/Default.aspx
        >>
        >Auther Plug
        >OWC Blackbook now on download at www.lulu.com/owc
        >>
        >"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
        >news:Oqo$bb6KJ HA.1160@TK2MSFT NGP05.phx.gbl.. .
        >>I hate to cross post, but I've gotten no answer yet on a problem I'm
        >>having with visual studio 2008.
        >>>
        >>I've created a series of forms with controls to access a Access database
        >>tables. The connection string works fine and the tables are added to the
        >>project without a problem.
        >>>
        >>When I create the tables they appear to bind and I am able to preview
        >>the
        >>data in the database in design mode; however, at runtime no data is
        >>displayed and the dataviewgrids don't allow me to update the tables.
        >>>
        >>I'm currently using C#, but have tried the same application in Visual
        >>Basic with the same results.
        >>>
        >>I've also tried re-creating the application (at least one of the windows
        >>forms) on a different computer with the same results. Not able to
        >>display
        >>the access tables.. As well as with SSCE as the data source.
        >>>
        >>I've checked MSDN and stepped through the Walkthroughs with no success.
        >>>
        >>Has anyone else seen this problem or provide me some guidance.
        >>
        >

        Comment

        • Wesley Peace

          #5
          Re: vstudio data access problems

          :'-]

          I would love to be able to provide all aspects of the program, but trying
          to do so would me I'm uploading quite a bit of code (which by the way I
          tried).

          So let me see if I can explain what I'm doing rather than upload what is
          unloadable.

          I've got an Access 2007 database created with some pretty generic tables
          (replicating a database I created in SQL two years ago that got lost).

          I'm experiencing the problem with each of the tables so the problem is not
          specific to a table. I can enter records in Access without a problem, but as
          there are some pretty complex relationships between the tables which are
          hard to relay to a secretary my goal was to mask that with a front-end of
          some sort. Thus the C# application.

          I created a project, one form and a database connection to access the
          database. The only error I have when moving the database into the project is
          one about the relationship (can't read them or something to that effect). I
          look at the database & tables and they've been added to the project.

          Binding a table, for example the Ledger table I mentioned works fine (it
          appears). I'm able to preview the (single) record in the database, so the
          binding works; however when I run the program and call the form the database
          navigation is greyed, no records are shown.

          As the problem involves stock code with stock controls and nothing really
          custom I thought I was providing as much of what I could. Sounds like not.

          Short of zipping up the entire project and posting it somewhere (which I
          don't have) it sounds like I'm stuck.

          Needless to say, I'm a bit disappointed as I've used VB for years in this
          type of situaiton and it's only been since moving to VS2008 that I've
          experiences this amount of frustration. I was actually able to access my SQL
          database with prior versions of VS.

          "Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote in
          message news:1CB170E0-060A-4B6E-B458-92DE0A6EAE91@mi crosoft.com...
          Your code does not compile. Did you review this link? I'm calling in Jon
          to yell at you.
          Review the instructions here.

          >
          --
          Regards,
          Alvin Bruney
          >
          Want a free copy of VS 2008 w/ MSDN premium subscription?
          Details at http://msmvps.com/blogs/alvin/Default.aspx
          >
          Auther Plug
          OWC Blackbook now on download at www.lulu.com/owc
          >
          "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
          news:e8$1x#8KJH A.1500@TK2MSFTN GP06.phx.gbl...
          >Thanks.
          >>
          >>
          >===frmMain.c s
          >>
          >using System;
          >using System.Collecti ons.Generic;
          >using System.Componen tModel;
          >using System.Data;
          >using System.Drawing;
          >using System.Linq;
          >using System.Text;
          >using System.Windows. Forms;
          >>
          >namespace ACRMS
          >{
          > public partial class frmMain : Form
          > {
          > public frmMain()
          > {
          > InitializeCompo nent();
          > }
          >>
          > private void miFileClose_Cli ck(object sender, EventArgs e)
          > {
          > Close();
          > }
          >>
          > private void miFormsRegister _Click(object sender, EventArgs e)
          > {
          > // frmRegister Registration = new frmRegister();
          > frmRegistration Registration = new frmRegistration ();
          > Registration.Md iParent = this;
          > Registration.Sh ow();
          >>
          > }
          >>
          > private void miFormsClubs_Cl ick(object sender, EventArgs e)
          > {
          > frmClubs Clubs = new frmClubs();
          > Clubs.MdiParent = this;
          > Clubs.Show();
          > }
          >>
          > private void miFormsLedger_C lick(object sender, EventArgs e)
          > {
          > frmLedger Ledger = new frmLedger(); ;
          > Ledger.MdiParen t = this;
          > Ledger.Show();
          > }
          > }
          >}
          >>
          >====frmLedger. cs
          >>
          >sing System;
          >using System.Collecti ons.Generic;
          >using System.Componen tModel;
          >using System.Data;
          >using System.Drawing;
          >using System.Linq;
          >using System.Text;
          >using System.Windows. Forms;
          >>
          >namespace ACRMS
          >{
          > public partial class frmLedger : Form
          > {
          > public frmLedger()
          > {
          > InitializeCompo nent();
          > }
          >>
          > private void frmLedger_Load( object sender, EventArgs e)
          > {
          > // TODO: This line of code loads data into the
          >'awanaDataSet. Ledger' table. You can move, or remove it, as needed.
          > this.LedgerTA.F ill(this.awanaD ataSet.Ledger);
          >>
          > }
          > }
          >}
          >>
          >===>frmLedger. Designer.cs
          >namespace ACRMS
          >{
          > partial class frmLedger
          > {
          > /// <summary>
          > /// Required designer variable.
          > /// </summary>
          > private System.Componen tModel.IContain er components = null;
          >>
          > /// <summary>
          > /// Clean up any resources being used.
          > /// </summary>
          > /// <param name="disposing ">true if managed resources should be
          >disposed; otherwise, false.</param>
          > protected override void Dispose(bool disposing)
          > {
          > if (disposing && (components != null))
          > {
          > components.Disp ose();
          > }
          > base.Dispose(di sposing);
          > }
          >>
          > #region Windows Form Designer generated code
          >>
          > /// <summary>
          > /// Required method for Designer support - do not modify
          > /// the contents of this method with the code editor.
          > /// </summary>
          > private void InitializeCompo nent()
          > {
          > this.components = new System.Componen tModel.Containe r();
          > System.Windows. Forms.DataGridV iewCellStyle
          >dataGridViewCe llStyle1 = new
          >System.Windows .Forms.DataGrid ViewCellStyle() ;
          > System.Windows. Forms.DataGridV iewCellStyle
          >dataGridViewCe llStyle2 = new
          >System.Windows .Forms.DataGrid ViewCellStyle() ;
          > System.Windows. Forms.DataGridV iewCellStyle
          >dataGridViewCe llStyle3 = new
          >System.Windows .Forms.DataGrid ViewCellStyle() ;
          > System.Windows. Forms.DataGridV iewCellStyle
          >dataGridViewCe llStyle4 = new
          >System.Windows .Forms.DataGrid ViewCellStyle() ;
          > System.Componen tModel.Componen tResourceManage r resources = new
          >System.Compone ntModel.Compone ntResourceManag er(typeof(frmLe dger));
          > this.statLedger = new System.Windows. Forms.StatusStr ip();
          > this.dgvLedger = new System.Windows. Forms.DataGridV iew();
          > this.awanaDataS et = new ACRMS.AwanaData Set();
          > this.LedgerBS = new
          >System.Windows .Forms.BindingS ource(this.comp onents);
          > this.LedgerTA = new
          >ACRMS.AwanaDat aSetTableAdapte rs.LedgerTableA dapter();
          > this.iDDataGrid ViewTextBoxColu mn = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.aDateDataG ridViewTextBoxC olumn = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.descriptio nDataGridViewTe xtBoxColumn = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.debitDataG ridViewTextBoxC olumn = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.creditData GridViewTextBox Column = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.Balance = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          > this.commentsDa taGridViewTextB oxColumn = new
          >System.Windows .Forms.DataGrid ViewTextBoxColu mn();
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.dgvLedger) ).BeginInit();
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.awanaDataS et)).BeginInit( );
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.LedgerBS)) .BeginInit();
          > this.SuspendLay out();
          > //
          > // statLedger
          > //
          > this.statLedger .Location = new System.Drawing. Point(0, 177);
          > this.statLedger .Name = "statLedger ";
          > this.statLedger .Size = new System.Drawing. Size(488, 22);
          > this.statLedger .TabIndex = 0;
          > this.statLedger .Text = "statusStri p1";
          > //
          > // dgvLedger
          > //
          > this.dgvLedger. AutoGenerateCol umns = false;
          > this.dgvLedger. ColumnHeadersHe ightSizeMode =
          >System.Windows .Forms.DataGrid ViewColumnHeade rsHeightSizeMod e.AutoSize;
          > this.dgvLedger. Columns.AddRang e(new
          >System.Windows .Forms.DataGrid ViewColumn[] {
          > this.iDDataGrid ViewTextBoxColu mn,
          > this.aDateDataG ridViewTextBoxC olumn,
          > this.descriptio nDataGridViewTe xtBoxColumn,
          > this.debitDataG ridViewTextBoxC olumn,
          > this.creditData GridViewTextBox Column,
          > this.Balance,
          > this.commentsDa taGridViewTextB oxColumn});
          > this.dgvLedger. DataSource = this.LedgerBS;
          > this.dgvLedger. Dock = System.Windows. Forms.DockStyle .Fill;
          > this.dgvLedger. Location = new System.Drawing. Point(0, 0);
          > this.dgvLedger. Name = "dgvLedger" ;
          > this.dgvLedger. Size = new System.Drawing. Size(488, 177);
          > this.dgvLedger. TabIndex = 1;
          > //
          > // awanaDataSet
          > //
          > this.awanaDataS et.DataSetName = "AwanaDataS et";
          > this.awanaDataS et.SchemaSerial izationMode =
          >System.Data.Sc hemaSerializati onMode.IncludeS chema;
          > //
          > // LedgerBS
          > //
          > this.LedgerBS.D ataMember = "Ledger";
          > this.LedgerBS.D ataSource = this.awanaDataS et;
          > //
          > // LedgerTA
          > //
          > this.LedgerTA.C learBeforeFill = true;
          > //
          > // iDDataGridViewT extBoxColumn
          > //
          > this.iDDataGrid ViewTextBoxColu mn.DataProperty Name = "ID";
          > this.iDDataGrid ViewTextBoxColu mn.HeaderText = "ID";
          > this.iDDataGrid ViewTextBoxColu mn.Name =
          >"iDDataGridVie wTextBoxColumn" ;
          > this.iDDataGrid ViewTextBoxColu mn.Visible = false;
          > //
          > // aDateDataGridVi ewTextBoxColumn
          > //
          > this.aDateDataG ridViewTextBoxC olumn.DataPrope rtyName =
          >"ADate";
          > dataGridViewCel lStyle1.Format = "d";
          > dataGridViewCel lStyle1.NullVal ue = null;
          > this.aDateDataG ridViewTextBoxC olumn.DefaultCe llStyle =
          >dataGridViewCe llStyle1;
          > this.aDateDataG ridViewTextBoxC olumn.HeaderTex t = "Date";
          > this.aDateDataG ridViewTextBoxC olumn.Name =
          >"aDateDataGrid ViewTextBoxColu mn";
          > this.aDateDataG ridViewTextBoxC olumn.Width = 75;
          > //
          > // descriptionData GridViewTextBox Column
          > //
          > this.descriptio nDataGridViewTe xtBoxColumn.Dat aPropertyName =
          >"Description ";
          > this.descriptio nDataGridViewTe xtBoxColumn.Hea derText =
          >"Description ";
          > this.descriptio nDataGridViewTe xtBoxColumn.Nam e =
          >"descriptionDa taGridViewTextB oxColumn";
          > this.descriptio nDataGridViewTe xtBoxColumn.Wid th = 150;
          > //
          > // debitDataGridVi ewTextBoxColumn
          > //
          > this.debitDataG ridViewTextBoxC olumn.DataPrope rtyName =
          >"Debit";
          > dataGridViewCel lStyle2.Alignme nt =
          >System.Windows .Forms.DataGrid ViewContentAlig nment.MiddleRig ht;
          > dataGridViewCel lStyle2.Format = "N2";
          > dataGridViewCel lStyle2.NullVal ue = "0";
          > this.debitDataG ridViewTextBoxC olumn.DefaultCe llStyle =
          >dataGridViewCe llStyle2;
          > this.debitDataG ridViewTextBoxC olumn.HeaderTex t = "Debit";
          > this.debitDataG ridViewTextBoxC olumn.Name =
          >"debitDataGrid ViewTextBoxColu mn";
          > this.debitDataG ridViewTextBoxC olumn.Resizable =
          >System.Windows .Forms.DataGrid ViewTriState.Fa lse;
          > this.debitDataG ridViewTextBoxC olumn.Width = 60;
          > //
          > // creditDataGridV iewTextBoxColum n
          > //
          > this.creditData GridViewTextBox Column.DataProp ertyName =
          >"Credit";
          > dataGridViewCel lStyle3.Alignme nt =
          >System.Windows .Forms.DataGrid ViewContentAlig nment.MiddleRig ht;
          > dataGridViewCel lStyle3.Format = "N2";
          > dataGridViewCel lStyle3.NullVal ue = "0";
          > this.creditData GridViewTextBox Column.DefaultC ellStyle =
          >dataGridViewCe llStyle3;
          > this.creditData GridViewTextBox Column.HeaderTe xt = "Credit";
          > this.creditData GridViewTextBox Column.Name =
          >"creditDataGri dViewTextBoxCol umn";
          > this.creditData GridViewTextBox Column.Width = 60;
          > //
          > // Balance
          > //
          > dataGridViewCel lStyle4.Alignme nt =
          >System.Windows .Forms.DataGrid ViewContentAlig nment.MiddleRig ht;
          > dataGridViewCel lStyle4.Format = "N2";
          > dataGridViewCel lStyle4.NullVal ue = "0";
          > this.Balance.De faultCellStyle = dataGridViewCel lStyle4;
          > this.Balance.He aderText = "Balance";
          > this.Balance.Na me = "Balance";
          > //
          > // commentsDataGri dViewTextBoxCol umn
          > //
          > this.commentsDa taGridViewTextB oxColumn.DataPr opertyName =
          >"Comments";
          > this.commentsDa taGridViewTextB oxColumn.Header Text =
          >"Comments";
          > this.commentsDa taGridViewTextB oxColumn.Name =
          >"commentsDataG ridViewTextBoxC olumn";
          > this.commentsDa taGridViewTextB oxColumn.Visibl e = false;
          > this.commentsDa taGridViewTextB oxColumn.Width = 250;
          > //
          > // frmLedger
          > //
          > this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
          > this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
          > this.ClientSize = new System.Drawing. Size(488, 199);
          > this.Controls.A dd(this.dgvLedg er);
          > this.Controls.A dd(this.statLed ger);
          > this.FormBorder Style =
          >System.Windows .Forms.FormBord erStyle.FixedDi alog;
          > this.Icon =
          >((System.Drawi ng.Icon)(resour ces.GetObject(" $this.Icon")));
          > this.MaximizeBo x = false;
          > this.Name = "frmLedger" ;
          > this.Text = "Ledger";
          > this.Load += new System.EventHan dler(this.frmLe dger_Load);
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.dgvLedger) ).EndInit();
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.awanaDataS et)).EndInit();
          >>
          >((System.Compo nentModel.ISupp ortInitialize)( this.LedgerBS)) .EndInit();
          > this.ResumeLayo ut(false);
          > this.PerformLay out();
          >>
          > }
          >>
          > #endregion
          >>
          > private System.Windows. Forms.StatusStr ip statLedger;
          > private System.Windows. Forms.DataGridV iew dgvLedger;
          > private AwanaDataSet awanaDataSet;
          > private System.Windows. Forms.BindingSo urce LedgerBS;
          > private ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter
          >LedgerTA;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >iDDataGridView TextBoxColumn;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >aDateDataGridV iewTextBoxColum n;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >descriptionDat aGridViewTextBo xColumn;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >debitDataGridV iewTextBoxColum n;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >creditDataGrid ViewTextBoxColu mn;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n Balance;
          > private System.Windows. Forms.DataGridV iewTextBoxColum n
          >commentsDataGr idViewTextBoxCo lumn;
          > }
          >}
          >>
          >I've had this minimal code load the table in prior versions of both VB as
          >well as C#. At this stage I've done no more than insure the table is
          >correctly loaded before proceeding further. One record exists in this
          >table
          >and it is not loaded. The bindingNav is actually greyed out and record
          >count
          >is 0.
          >>
          >This is the data in the table to be loaded.
          >>
          >"ID","ADate"," Description","D ebit","Credit", "Comments"
          >1,10/3/2008 0:00:00,"Dues", $67.00,$0.00,
          >>
          >>
          >"Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote
          >in
          >message news:26CAF77B-3A19-4A58-A119-2A454C528528@mi crosoft.com...
          >>Post your code with sample data.
          >>>
          >>--
          >>Regards,
          >>Alvin Bruney
          >>>
          >>Want a free copy of VS 2008 w/ MSDN premium subscription?
          >>Details at http://msmvps.com/blogs/alvin/Default.aspx
          >>>
          >>Auther Plug
          >>OWC Blackbook now on download at www.lulu.com/owc
          >>>
          >>"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
          >>news:Oqo$bb6K JHA.1160@TK2MSF TNGP05.phx.gbl. ..
          >>>I hate to cross post, but I've gotten no answer yet on a problem I'm
          >>>having with visual studio 2008.
          >>>>
          >>>I've created a series of forms with controls to access a Access
          >>>database
          >>>tables. The connection string works fine and the tables are added to
          >>>the
          >>>project without a problem.
          >>>>
          >>>When I create the tables they appear to bind and I am able to preview
          >>>the
          >>>data in the database in design mode; however, at runtime no data is
          >>>displayed and the dataviewgrids don't allow me to update the tables.
          >>>>
          >>>I'm currently using C#, but have tried the same application in Visual
          >>>Basic with the same results.
          >>>>
          >>>I've also tried re-creating the application (at least one of the
          >>>windows
          >>>forms) on a different computer with the same results. Not able to
          >>>display
          >>>the access tables.. As well as with SSCE as the data source.
          >>>>
          >>>I've checked MSDN and stepped through the Walkthroughs with no success.
          >>>>
          >>>Has anyone else seen this problem or provide me some guidance.
          >>>
          >>

          Comment

          • William Vaughn \(MVP\)

            #6
            Re: vstudio data access problems

            When the tables were created, did you create a primary key for each?

            --
            _______________ _______________ _______________ _______________ ______________
            William R. Vaughn
            President and Founder Beta V Corporation
            Author, Mentor, Dad, Grandpa
            Microsoft MVP
            (425) 556-9205 (Pacific time)
            Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
            _______________ _______________ _______________ _______________ _______________ _______________ __



            "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
            news:OK8PsgMLJH A.5164@TK2MSFTN GP04.phx.gbl...
            :'-]
            >
            I would love to be able to provide all aspects of the program, but trying
            to do so would me I'm uploading quite a bit of code (which by the way I
            tried).
            >
            So let me see if I can explain what I'm doing rather than upload what is
            unloadable.
            >
            I've got an Access 2007 database created with some pretty generic tables
            (replicating a database I created in SQL two years ago that got lost).
            >
            I'm experiencing the problem with each of the tables so the problem is not
            specific to a table. I can enter records in Access without a problem, but
            as there are some pretty complex relationships between the tables which
            are hard to relay to a secretary my goal was to mask that with a front-end
            of some sort. Thus the C# application.
            >
            I created a project, one form and a database connection to access the
            database. The only error I have when moving the database into the project
            is one about the relationship (can't read them or something to that
            effect). I look at the database & tables and they've been added to the
            project.
            >
            Binding a table, for example the Ledger table I mentioned works fine (it
            appears). I'm able to preview the (single) record in the database, so the
            binding works; however when I run the program and call the form the
            database navigation is greyed, no records are shown.
            >
            As the problem involves stock code with stock controls and nothing really
            custom I thought I was providing as much of what I could. Sounds like not.
            >
            Short of zipping up the entire project and posting it somewhere (which I
            don't have) it sounds like I'm stuck.
            >
            Needless to say, I'm a bit disappointed as I've used VB for years in this
            type of situaiton and it's only been since moving to VS2008 that I've
            experiences this amount of frustration. I was actually able to access my
            SQL database with prior versions of VS.
            >
            "Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote in
            message news:1CB170E0-060A-4B6E-B458-92DE0A6EAE91@mi crosoft.com...
            >Your code does not compile. Did you review this link? I'm calling in Jon
            >to yell at you.
            >Review the instructions here.
            >http://www.yoda.arachsys.com/csharp/complete.html
            >>
            >--
            >Regards,
            >Alvin Bruney
            >>
            >Want a free copy of VS 2008 w/ MSDN premium subscription?
            >Details at http://msmvps.com/blogs/alvin/Default.aspx
            >>
            >Auther Plug
            >OWC Blackbook now on download at www.lulu.com/owc
            >>
            >"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
            >news:e8$1x#8KJ HA.1500@TK2MSFT NGP06.phx.gbl.. .
            >>Thanks.
            >>>
            >>>
            >>===frmMain. cs
            >>>
            >>using System;
            >>using System.Collecti ons.Generic;
            >>using System.Componen tModel;
            >>using System.Data;
            >>using System.Drawing;
            >>using System.Linq;
            >>using System.Text;
            >>using System.Windows. Forms;
            >>>
            >>namespace ACRMS
            >>{
            >> public partial class frmMain : Form
            >> {
            >> public frmMain()
            >> {
            >> InitializeCompo nent();
            >> }
            >>>
            >> private void miFileClose_Cli ck(object sender, EventArgs e)
            >> {
            >> Close();
            >> }
            >>>
            >> private void miFormsRegister _Click(object sender, EventArgs e)
            >> {
            >> // frmRegister Registration = new frmRegister();
            >> frmRegistration Registration = new frmRegistration ();
            >> Registration.Md iParent = this;
            >> Registration.Sh ow();
            >>>
            >> }
            >>>
            >> private void miFormsClubs_Cl ick(object sender, EventArgs e)
            >> {
            >> frmClubs Clubs = new frmClubs();
            >> Clubs.MdiParent = this;
            >> Clubs.Show();
            >> }
            >>>
            >> private void miFormsLedger_C lick(object sender, EventArgs e)
            >> {
            >> frmLedger Ledger = new frmLedger(); ;
            >> Ledger.MdiParen t = this;
            >> Ledger.Show();
            >> }
            >> }
            >>}
            >>>
            >>====frmLedger .cs
            >>>
            >>sing System;
            >>using System.Collecti ons.Generic;
            >>using System.Componen tModel;
            >>using System.Data;
            >>using System.Drawing;
            >>using System.Linq;
            >>using System.Text;
            >>using System.Windows. Forms;
            >>>
            >>namespace ACRMS
            >>{
            >> public partial class frmLedger : Form
            >> {
            >> public frmLedger()
            >> {
            >> InitializeCompo nent();
            >> }
            >>>
            >> private void frmLedger_Load( object sender, EventArgs e)
            >> {
            >> // TODO: This line of code loads data into the
            >>'awanaDataSet .Ledger' table. You can move, or remove it, as needed.
            >> this.LedgerTA.F ill(this.awanaD ataSet.Ledger);
            >>>
            >> }
            >> }
            >>}
            >>>
            >>===>frmLedger .Designer.cs
            >>namespace ACRMS
            >>{
            >> partial class frmLedger
            >> {
            >> /// <summary>
            >> /// Required designer variable.
            >> /// </summary>
            >> private System.Componen tModel.IContain er components = null;
            >>>
            >> /// <summary>
            >> /// Clean up any resources being used.
            >> /// </summary>
            >> /// <param name="disposing ">true if managed resources should be
            >>disposed; otherwise, false.</param>
            >> protected override void Dispose(bool disposing)
            >> {
            >> if (disposing && (components != null))
            >> {
            >> components.Disp ose();
            >> }
            >> base.Dispose(di sposing);
            >> }
            >>>
            >> #region Windows Form Designer generated code
            >>>
            >> /// <summary>
            >> /// Required method for Designer support - do not modify
            >> /// the contents of this method with the code editor.
            >> /// </summary>
            >> private void InitializeCompo nent()
            >> {
            >> this.components = new System.Componen tModel.Containe r();
            >> System.Windows. Forms.DataGridV iewCellStyle
            >>dataGridViewC ellStyle1 = new
            >>System.Window s.Forms.DataGri dViewCellStyle( );
            >> System.Windows. Forms.DataGridV iewCellStyle
            >>dataGridViewC ellStyle2 = new
            >>System.Window s.Forms.DataGri dViewCellStyle( );
            >> System.Windows. Forms.DataGridV iewCellStyle
            >>dataGridViewC ellStyle3 = new
            >>System.Window s.Forms.DataGri dViewCellStyle( );
            >> System.Windows. Forms.DataGridV iewCellStyle
            >>dataGridViewC ellStyle4 = new
            >>System.Window s.Forms.DataGri dViewCellStyle( );
            >> System.Componen tModel.Componen tResourceManage r resources =
            >>new
            >>System.Compon entModel.Compon entResourceMana ger(typeof(frmL edger));
            >> this.statLedger = new System.Windows. Forms.StatusStr ip();
            >> this.dgvLedger = new System.Windows. Forms.DataGridV iew();
            >> this.awanaDataS et = new ACRMS.AwanaData Set();
            >> this.LedgerBS = new
            >>System.Window s.Forms.Binding Source(this.com ponents);
            >> this.LedgerTA = new
            >>ACRMS.AwanaDa taSetTableAdapt ers.LedgerTable Adapter();
            >> this.iDDataGrid ViewTextBoxColu mn = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.aDateDataG ridViewTextBoxC olumn = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.descriptio nDataGridViewTe xtBoxColumn = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.debitDataG ridViewTextBoxC olumn = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.creditData GridViewTextBox Column = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.Balance = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >> this.commentsDa taGridViewTextB oxColumn = new
            >>System.Window s.Forms.DataGri dViewTextBoxCol umn();
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.dgvLedger )).BeginInit();
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.awanaData Set)).BeginInit ();
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.LedgerBS) ).BeginInit();
            >> this.SuspendLay out();
            >> //
            >> // statLedger
            >> //
            >> this.statLedger .Location = new System.Drawing. Point(0, 177);
            >> this.statLedger .Name = "statLedger ";
            >> this.statLedger .Size = new System.Drawing. Size(488, 22);
            >> this.statLedger .TabIndex = 0;
            >> this.statLedger .Text = "statusStri p1";
            >> //
            >> // dgvLedger
            >> //
            >> this.dgvLedger. AutoGenerateCol umns = false;
            >> this.dgvLedger. ColumnHeadersHe ightSizeMode =
            >>System.Window s.Forms.DataGri dViewColumnHead ersHeightSizeMo de.AutoSize;
            >> this.dgvLedger. Columns.AddRang e(new
            >>System.Window s.Forms.DataGri dViewColumn[] {
            >> this.iDDataGrid ViewTextBoxColu mn,
            >> this.aDateDataG ridViewTextBoxC olumn,
            >> this.descriptio nDataGridViewTe xtBoxColumn,
            >> this.debitDataG ridViewTextBoxC olumn,
            >> this.creditData GridViewTextBox Column,
            >> this.Balance,
            >> this.commentsDa taGridViewTextB oxColumn});
            >> this.dgvLedger. DataSource = this.LedgerBS;
            >> this.dgvLedger. Dock = System.Windows. Forms.DockStyle .Fill;
            >> this.dgvLedger. Location = new System.Drawing. Point(0, 0);
            >> this.dgvLedger. Name = "dgvLedger" ;
            >> this.dgvLedger. Size = new System.Drawing. Size(488, 177);
            >> this.dgvLedger. TabIndex = 1;
            >> //
            >> // awanaDataSet
            >> //
            >> this.awanaDataS et.DataSetName = "AwanaDataS et";
            >> this.awanaDataS et.SchemaSerial izationMode =
            >>System.Data.S chemaSerializat ionMode.Include Schema;
            >> //
            >> // LedgerBS
            >> //
            >> this.LedgerBS.D ataMember = "Ledger";
            >> this.LedgerBS.D ataSource = this.awanaDataS et;
            >> //
            >> // LedgerTA
            >> //
            >> this.LedgerTA.C learBeforeFill = true;
            >> //
            >> // iDDataGridViewT extBoxColumn
            >> //
            >> this.iDDataGrid ViewTextBoxColu mn.DataProperty Name = "ID";
            >> this.iDDataGrid ViewTextBoxColu mn.HeaderText = "ID";
            >> this.iDDataGrid ViewTextBoxColu mn.Name =
            >>"iDDataGridVi ewTextBoxColumn ";
            >> this.iDDataGrid ViewTextBoxColu mn.Visible = false;
            >> //
            >> // aDateDataGridVi ewTextBoxColumn
            >> //
            >> this.aDateDataG ridViewTextBoxC olumn.DataPrope rtyName =
            >>"ADate";
            >> dataGridViewCel lStyle1.Format = "d";
            >> dataGridViewCel lStyle1.NullVal ue = null;
            >> this.aDateDataG ridViewTextBoxC olumn.DefaultCe llStyle =
            >>dataGridViewC ellStyle1;
            >> this.aDateDataG ridViewTextBoxC olumn.HeaderTex t = "Date";
            >> this.aDateDataG ridViewTextBoxC olumn.Name =
            >>"aDateDataGri dViewTextBoxCol umn";
            >> this.aDateDataG ridViewTextBoxC olumn.Width = 75;
            >> //
            >> // descriptionData GridViewTextBox Column
            >> //
            >> this.descriptio nDataGridViewTe xtBoxColumn.Dat aPropertyName =
            >>"Description" ;
            >> this.descriptio nDataGridViewTe xtBoxColumn.Hea derText =
            >>"Description" ;
            >> this.descriptio nDataGridViewTe xtBoxColumn.Nam e =
            >>"descriptionD ataGridViewText BoxColumn";
            >> this.descriptio nDataGridViewTe xtBoxColumn.Wid th = 150;
            >> //
            >> // debitDataGridVi ewTextBoxColumn
            >> //
            >> this.debitDataG ridViewTextBoxC olumn.DataPrope rtyName =
            >>"Debit";
            >> dataGridViewCel lStyle2.Alignme nt =
            >>System.Window s.Forms.DataGri dViewContentAli gnment.MiddleRi ght;
            >> dataGridViewCel lStyle2.Format = "N2";
            >> dataGridViewCel lStyle2.NullVal ue = "0";
            >> this.debitDataG ridViewTextBoxC olumn.DefaultCe llStyle =
            >>dataGridViewC ellStyle2;
            >> this.debitDataG ridViewTextBoxC olumn.HeaderTex t = "Debit";
            >> this.debitDataG ridViewTextBoxC olumn.Name =
            >>"debitDataGri dViewTextBoxCol umn";
            >> this.debitDataG ridViewTextBoxC olumn.Resizable =
            >>System.Window s.Forms.DataGri dViewTriState.F alse;
            >> this.debitDataG ridViewTextBoxC olumn.Width = 60;
            >> //
            >> // creditDataGridV iewTextBoxColum n
            >> //
            >> this.creditData GridViewTextBox Column.DataProp ertyName =
            >>"Credit";
            >> dataGridViewCel lStyle3.Alignme nt =
            >>System.Window s.Forms.DataGri dViewContentAli gnment.MiddleRi ght;
            >> dataGridViewCel lStyle3.Format = "N2";
            >> dataGridViewCel lStyle3.NullVal ue = "0";
            >> this.creditData GridViewTextBox Column.DefaultC ellStyle =
            >>dataGridViewC ellStyle3;
            >> this.creditData GridViewTextBox Column.HeaderTe xt = "Credit";
            >> this.creditData GridViewTextBox Column.Name =
            >>"creditDataGr idViewTextBoxCo lumn";
            >> this.creditData GridViewTextBox Column.Width = 60;
            >> //
            >> // Balance
            >> //
            >> dataGridViewCel lStyle4.Alignme nt =
            >>System.Window s.Forms.DataGri dViewContentAli gnment.MiddleRi ght;
            >> dataGridViewCel lStyle4.Format = "N2";
            >> dataGridViewCel lStyle4.NullVal ue = "0";
            >> this.Balance.De faultCellStyle = dataGridViewCel lStyle4;
            >> this.Balance.He aderText = "Balance";
            >> this.Balance.Na me = "Balance";
            >> //
            >> // commentsDataGri dViewTextBoxCol umn
            >> //
            >> this.commentsDa taGridViewTextB oxColumn.DataPr opertyName =
            >>"Comments";
            >> this.commentsDa taGridViewTextB oxColumn.Header Text =
            >>"Comments";
            >> this.commentsDa taGridViewTextB oxColumn.Name =
            >>"commentsData GridViewTextBox Column";
            >> this.commentsDa taGridViewTextB oxColumn.Visibl e = false;
            >> this.commentsDa taGridViewTextB oxColumn.Width = 250;
            >> //
            >> // frmLedger
            >> //
            >> this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
            >> this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
            >> this.ClientSize = new System.Drawing. Size(488, 199);
            >> this.Controls.A dd(this.dgvLedg er);
            >> this.Controls.A dd(this.statLed ger);
            >> this.FormBorder Style =
            >>System.Window s.Forms.FormBor derStyle.FixedD ialog;
            >> this.Icon =
            >>((System.Draw ing.Icon)(resou rces.GetObject( "$this.Icon"))) ;
            >> this.MaximizeBo x = false;
            >> this.Name = "frmLedger" ;
            >> this.Text = "Ledger";
            >> this.Load += new System.EventHan dler(this.frmLe dger_Load);
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.dgvLedger )).EndInit();
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.awanaData Set)).EndInit() ;
            >>>
            >>((System.Comp onentModel.ISup portInitialize) (this.LedgerBS) ).EndInit();
            >> this.ResumeLayo ut(false);
            >> this.PerformLay out();
            >>>
            >> }
            >>>
            >> #endregion
            >>>
            >> private System.Windows. Forms.StatusStr ip statLedger;
            >> private System.Windows. Forms.DataGridV iew dgvLedger;
            >> private AwanaDataSet awanaDataSet;
            >> private System.Windows. Forms.BindingSo urce LedgerBS;
            >> private ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter
            >>LedgerTA;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>iDDataGridVie wTextBoxColumn;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>aDateDataGrid ViewTextBoxColu mn;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>descriptionDa taGridViewTextB oxColumn;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>debitDataGrid ViewTextBoxColu mn;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>creditDataGri dViewTextBoxCol umn;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n Balance;
            >> private System.Windows. Forms.DataGridV iewTextBoxColum n
            >>commentsDataG ridViewTextBoxC olumn;
            >> }
            >>}
            >>>
            >>I've had this minimal code load the table in prior versions of both VB
            >>as
            >>well as C#. At this stage I've done no more than insure the table is
            >>correctly loaded before proceeding further. One record exists in this
            >>table
            >>and it is not loaded. The bindingNav is actually greyed out and record
            >>count
            >>is 0.
            >>>
            >>This is the data in the table to be loaded.
            >>>
            >>"ID","ADate", "Description"," Debit","Credit" ,"Comments"
            >>1,10/3/2008 0:00:00,"Dues", $67.00,$0.00,
            >>>
            >>>
            >>"Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote
            >>in
            >>message news:26CAF77B-3A19-4A58-A119-2A454C528528@mi crosoft.com...
            >>>Post your code with sample data.
            >>>>
            >>>--
            >>>Regards,
            >>>Alvin Bruney
            >>>>
            >>>Want a free copy of VS 2008 w/ MSDN premium subscription?
            >>>Details at http://msmvps.com/blogs/alvin/Default.aspx
            >>>>
            >>>Auther Plug
            >>>OWC Blackbook now on download at www.lulu.com/owc
            >>>>
            >>>"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
            >>>news:Oqo$bb6 KJHA.1160@TK2MS FTNGP05.phx.gbl ...
            >>>>I hate to cross post, but I've gotten no answer yet on a problem I'm
            >>>>having with visual studio 2008.
            >>>>>
            >>>>I've created a series of forms with controls to access a Access
            >>>>database
            >>>>tables. The connection string works fine and the tables are added to
            >>>>the
            >>>>project without a problem.
            >>>>>
            >>>>When I create the tables they appear to bind and I am able to preview
            >>>>the
            >>>>data in the database in design mode; however, at runtime no data is
            >>>>displayed and the dataviewgrids don't allow me to update the tables.
            >>>>>
            >>>>I'm currently using C#, but have tried the same application in Visual
            >>>>Basic with the same results.
            >>>>>
            >>>>I've also tried re-creating the application (at least one of the
            >>>>windows
            >>>>forms) on a different computer with the same results. Not able to
            >>>>display
            >>>>the access tables.. As well as with SSCE as the data source.
            >>>>>
            >>>>I've checked MSDN and stepped through the Walkthroughs with no
            >>>>success.
            >>>>>
            >>>>Has anyone else seen this problem or provide me some guidance.
            >>>>
            >>>
            >

            Comment

            • Wesley Peace

              #7
              Re: vstudio data access problems

              Yes

              "William Vaughn (MVP)" <billva@NoSpamB etav.comwrote in message
              news:9037E884-B2D3-47EA-B9AD-72AAF0F3A9D8@mi crosoft.com...
              When the tables were created, did you create a primary key for each?
              >
              --
              _______________ _______________ _______________ _______________ ______________
              William R. Vaughn
              President and Founder Beta V Corporation
              Author, Mentor, Dad, Grandpa
              Microsoft MVP
              (425) 556-9205 (Pacific time)
              Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
              _______________ _______________ _______________ _______________ _______________ _______________ __
              >
              >
              >
              "Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
              news:OK8PsgMLJH A.5164@TK2MSFTN GP04.phx.gbl...
              >:'-]
              >>
              >I would love to be able to provide all aspects of the program, but
              >trying to do so would me I'm uploading quite a bit of code (which by the
              >way I tried).
              >>
              >So let me see if I can explain what I'm doing rather than upload what is
              >unloadable.
              >>
              >I've got an Access 2007 database created with some pretty generic tables
              >(replicating a database I created in SQL two years ago that got lost).
              >>
              >I'm experiencing the problem with each of the tables so the problem is
              >not specific to a table. I can enter records in Access without a problem,
              >but as there are some pretty complex relationships between the tables
              >which are hard to relay to a secretary my goal was to mask that with a
              >front-end of some sort. Thus the C# application.
              >>
              >I created a project, one form and a database connection to access the
              >database. The only error I have when moving the database into the project
              >is one about the relationship (can't read them or something to that
              >effect). I look at the database & tables and they've been added to the
              >project.
              >>
              >Binding a table, for example the Ledger table I mentioned works fine (it
              >appears). I'm able to preview the (single) record in the database, so the
              >binding works; however when I run the program and call the form the
              >database navigation is greyed, no records are shown.
              >>
              >As the problem involves stock code with stock controls and nothing really
              >custom I thought I was providing as much of what I could. Sounds like
              >not.
              >>
              >Short of zipping up the entire project and posting it somewhere (which I
              >don't have) it sounds like I'm stuck.
              >>
              >Needless to say, I'm a bit disappointed as I've used VB for years in this
              >type of situaiton and it's only been since moving to VS2008 that I've
              >experiences this amount of frustration. I was actually able to access my
              >SQL database with prior versions of VS.
              >>
              >"Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote
              >in message news:1CB170E0-060A-4B6E-B458-92DE0A6EAE91@mi crosoft.com...
              >>Your code does not compile. Did you review this link? I'm calling in Jon
              >>to yell at you.
              >>Review the instructions here.
              >>http://www.yoda.arachsys.com/csharp/complete.html
              >>>
              >>--
              >>Regards,
              >>Alvin Bruney
              >>>
              >>Want a free copy of VS 2008 w/ MSDN premium subscription?
              >>Details at http://msmvps.com/blogs/alvin/Default.aspx
              >>>
              >>Auther Plug
              >>OWC Blackbook now on download at www.lulu.com/owc
              >>>
              >>"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
              >>news:e8$1x#8K JHA.1500@TK2MSF TNGP06.phx.gbl. ..
              >>>Thanks.
              >>>>
              >>>>
              >>>===frmMain.c s
              >>>>
              >>>using System;
              >>>using System.Collecti ons.Generic;
              >>>using System.Componen tModel;
              >>>using System.Data;
              >>>using System.Drawing;
              >>>using System.Linq;
              >>>using System.Text;
              >>>using System.Windows. Forms;
              >>>>
              >>>namespace ACRMS
              >>>{
              >>> public partial class frmMain : Form
              >>> {
              >>> public frmMain()
              >>> {
              >>> InitializeCompo nent();
              >>> }
              >>>>
              >>> private void miFileClose_Cli ck(object sender, EventArgs e)
              >>> {
              >>> Close();
              >>> }
              >>>>
              >>> private void miFormsRegister _Click(object sender, EventArgs e)
              >>> {
              >>> // frmRegister Registration = new frmRegister();
              >>> frmRegistration Registration = new frmRegistration ();
              >>> Registration.Md iParent = this;
              >>> Registration.Sh ow();
              >>>>
              >>> }
              >>>>
              >>> private void miFormsClubs_Cl ick(object sender, EventArgs e)
              >>> {
              >>> frmClubs Clubs = new frmClubs();
              >>> Clubs.MdiParent = this;
              >>> Clubs.Show();
              >>> }
              >>>>
              >>> private void miFormsLedger_C lick(object sender, EventArgs e)
              >>> {
              >>> frmLedger Ledger = new frmLedger(); ;
              >>> Ledger.MdiParen t = this;
              >>> Ledger.Show();
              >>> }
              >>> }
              >>>}
              >>>>
              >>>====frmLedge r.cs
              >>>>
              >>>sing System;
              >>>using System.Collecti ons.Generic;
              >>>using System.Componen tModel;
              >>>using System.Data;
              >>>using System.Drawing;
              >>>using System.Linq;
              >>>using System.Text;
              >>>using System.Windows. Forms;
              >>>>
              >>>namespace ACRMS
              >>>{
              >>> public partial class frmLedger : Form
              >>> {
              >>> public frmLedger()
              >>> {
              >>> InitializeCompo nent();
              >>> }
              >>>>
              >>> private void frmLedger_Load( object sender, EventArgs e)
              >>> {
              >>> // TODO: This line of code loads data into the
              >>>'awanaDataSe t.Ledger' table. You can move, or remove it, as needed.
              >>> this.LedgerTA.F ill(this.awanaD ataSet.Ledger);
              >>>>
              >>> }
              >>> }
              >>>}
              >>>>
              >>>===>frmLedge r.Designer.cs
              >>>namespace ACRMS
              >>>{
              >>> partial class frmLedger
              >>> {
              >>> /// <summary>
              >>> /// Required designer variable.
              >>> /// </summary>
              >>> private System.Componen tModel.IContain er components = null;
              >>>>
              >>> /// <summary>
              >>> /// Clean up any resources being used.
              >>> /// </summary>
              >>> /// <param name="disposing ">true if managed resources should be
              >>>disposed; otherwise, false.</param>
              >>> protected override void Dispose(bool disposing)
              >>> {
              >>> if (disposing && (components != null))
              >>> {
              >>> components.Disp ose();
              >>> }
              >>> base.Dispose(di sposing);
              >>> }
              >>>>
              >>> #region Windows Form Designer generated code
              >>>>
              >>> /// <summary>
              >>> /// Required method for Designer support - do not modify
              >>> /// the contents of this method with the code editor.
              >>> /// </summary>
              >>> private void InitializeCompo nent()
              >>> {
              >>> this.components = new System.Componen tModel.Containe r();
              >>> System.Windows. Forms.DataGridV iewCellStyle
              >>>dataGridView CellStyle1 = new
              >>>System.Windo ws.Forms.DataGr idViewCellStyle ();
              >>> System.Windows. Forms.DataGridV iewCellStyle
              >>>dataGridView CellStyle2 = new
              >>>System.Windo ws.Forms.DataGr idViewCellStyle ();
              >>> System.Windows. Forms.DataGridV iewCellStyle
              >>>dataGridView CellStyle3 = new
              >>>System.Windo ws.Forms.DataGr idViewCellStyle ();
              >>> System.Windows. Forms.DataGridV iewCellStyle
              >>>dataGridView CellStyle4 = new
              >>>System.Windo ws.Forms.DataGr idViewCellStyle ();
              >>> System.Componen tModel.Componen tResourceManage r resources =
              >>>new
              >>>System.Compo nentModel.Compo nentResourceMan ager(typeof(frm Ledger));
              >>> this.statLedger = new System.Windows. Forms.StatusStr ip();
              >>> this.dgvLedger = new System.Windows. Forms.DataGridV iew();
              >>> this.awanaDataS et = new ACRMS.AwanaData Set();
              >>> this.LedgerBS = new
              >>>System.Windo ws.Forms.Bindin gSource(this.co mponents);
              >>> this.LedgerTA = new
              >>>ACRMS.AwanaD ataSetTableAdap ters.LedgerTabl eAdapter();
              >>> this.iDDataGrid ViewTextBoxColu mn = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.aDateDataG ridViewTextBoxC olumn = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.descriptio nDataGridViewTe xtBoxColumn = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.debitDataG ridViewTextBoxC olumn = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.creditData GridViewTextBox Column = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.Balance = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>> this.commentsDa taGridViewTextB oxColumn = new
              >>>System.Windo ws.Forms.DataGr idViewTextBoxCo lumn();
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.dgvLedge r)).BeginInit() ;
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.awanaDat aSet)).BeginIni t();
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.LedgerBS )).BeginInit();
              >>> this.SuspendLay out();
              >>> //
              >>> // statLedger
              >>> //
              >>> this.statLedger .Location = new System.Drawing. Point(0, 177);
              >>> this.statLedger .Name = "statLedger ";
              >>> this.statLedger .Size = new System.Drawing. Size(488, 22);
              >>> this.statLedger .TabIndex = 0;
              >>> this.statLedger .Text = "statusStri p1";
              >>> //
              >>> // dgvLedger
              >>> //
              >>> this.dgvLedger. AutoGenerateCol umns = false;
              >>> this.dgvLedger. ColumnHeadersHe ightSizeMode =
              >>>System.Windo ws.Forms.DataGr idViewColumnHea dersHeightSizeM ode.AutoSize;
              >>> this.dgvLedger. Columns.AddRang e(new
              >>>System.Windo ws.Forms.DataGr idViewColumn[] {
              >>> this.iDDataGrid ViewTextBoxColu mn,
              >>> this.aDateDataG ridViewTextBoxC olumn,
              >>> this.descriptio nDataGridViewTe xtBoxColumn,
              >>> this.debitDataG ridViewTextBoxC olumn,
              >>> this.creditData GridViewTextBox Column,
              >>> this.Balance,
              >>> this.commentsDa taGridViewTextB oxColumn});
              >>> this.dgvLedger. DataSource = this.LedgerBS;
              >>> this.dgvLedger. Dock = System.Windows. Forms.DockStyle .Fill;
              >>> this.dgvLedger. Location = new System.Drawing. Point(0, 0);
              >>> this.dgvLedger. Name = "dgvLedger" ;
              >>> this.dgvLedger. Size = new System.Drawing. Size(488, 177);
              >>> this.dgvLedger. TabIndex = 1;
              >>> //
              >>> // awanaDataSet
              >>> //
              >>> this.awanaDataS et.DataSetName = "AwanaDataS et";
              >>> this.awanaDataS et.SchemaSerial izationMode =
              >>>System.Data. SchemaSerializa tionMode.Includ eSchema;
              >>> //
              >>> // LedgerBS
              >>> //
              >>> this.LedgerBS.D ataMember = "Ledger";
              >>> this.LedgerBS.D ataSource = this.awanaDataS et;
              >>> //
              >>> // LedgerTA
              >>> //
              >>> this.LedgerTA.C learBeforeFill = true;
              >>> //
              >>> // iDDataGridViewT extBoxColumn
              >>> //
              >>> this.iDDataGrid ViewTextBoxColu mn.DataProperty Name = "ID";
              >>> this.iDDataGrid ViewTextBoxColu mn.HeaderText = "ID";
              >>> this.iDDataGrid ViewTextBoxColu mn.Name =
              >>>"iDDataGridV iewTextBoxColum n";
              >>> this.iDDataGrid ViewTextBoxColu mn.Visible = false;
              >>> //
              >>> // aDateDataGridVi ewTextBoxColumn
              >>> //
              >>> this.aDateDataG ridViewTextBoxC olumn.DataPrope rtyName =
              >>>"ADate";
              >>> dataGridViewCel lStyle1.Format = "d";
              >>> dataGridViewCel lStyle1.NullVal ue = null;
              >>> this.aDateDataG ridViewTextBoxC olumn.DefaultCe llStyle =
              >>>dataGridView CellStyle1;
              >>> this.aDateDataG ridViewTextBoxC olumn.HeaderTex t = "Date";
              >>> this.aDateDataG ridViewTextBoxC olumn.Name =
              >>>"aDateDataGr idViewTextBoxCo lumn";
              >>> this.aDateDataG ridViewTextBoxC olumn.Width = 75;
              >>> //
              >>> // descriptionData GridViewTextBox Column
              >>> //
              >>> this.descriptio nDataGridViewTe xtBoxColumn.Dat aPropertyName =
              >>>"Description ";
              >>> this.descriptio nDataGridViewTe xtBoxColumn.Hea derText =
              >>>"Description ";
              >>> this.descriptio nDataGridViewTe xtBoxColumn.Nam e =
              >>>"description DataGridViewTex tBoxColumn";
              >>> this.descriptio nDataGridViewTe xtBoxColumn.Wid th = 150;
              >>> //
              >>> // debitDataGridVi ewTextBoxColumn
              >>> //
              >>> this.debitDataG ridViewTextBoxC olumn.DataPrope rtyName =
              >>>"Debit";
              >>> dataGridViewCel lStyle2.Alignme nt =
              >>>System.Windo ws.Forms.DataGr idViewContentAl ignment.MiddleR ight;
              >>> dataGridViewCel lStyle2.Format = "N2";
              >>> dataGridViewCel lStyle2.NullVal ue = "0";
              >>> this.debitDataG ridViewTextBoxC olumn.DefaultCe llStyle =
              >>>dataGridView CellStyle2;
              >>> this.debitDataG ridViewTextBoxC olumn.HeaderTex t = "Debit";
              >>> this.debitDataG ridViewTextBoxC olumn.Name =
              >>>"debitDataGr idViewTextBoxCo lumn";
              >>> this.debitDataG ridViewTextBoxC olumn.Resizable =
              >>>System.Windo ws.Forms.DataGr idViewTriState. False;
              >>> this.debitDataG ridViewTextBoxC olumn.Width = 60;
              >>> //
              >>> // creditDataGridV iewTextBoxColum n
              >>> //
              >>> this.creditData GridViewTextBox Column.DataProp ertyName =
              >>>"Credit";
              >>> dataGridViewCel lStyle3.Alignme nt =
              >>>System.Windo ws.Forms.DataGr idViewContentAl ignment.MiddleR ight;
              >>> dataGridViewCel lStyle3.Format = "N2";
              >>> dataGridViewCel lStyle3.NullVal ue = "0";
              >>> this.creditData GridViewTextBox Column.DefaultC ellStyle =
              >>>dataGridView CellStyle3;
              >>> this.creditData GridViewTextBox Column.HeaderTe xt = "Credit";
              >>> this.creditData GridViewTextBox Column.Name =
              >>>"creditDataG ridViewTextBoxC olumn";
              >>> this.creditData GridViewTextBox Column.Width = 60;
              >>> //
              >>> // Balance
              >>> //
              >>> dataGridViewCel lStyle4.Alignme nt =
              >>>System.Windo ws.Forms.DataGr idViewContentAl ignment.MiddleR ight;
              >>> dataGridViewCel lStyle4.Format = "N2";
              >>> dataGridViewCel lStyle4.NullVal ue = "0";
              >>> this.Balance.De faultCellStyle = dataGridViewCel lStyle4;
              >>> this.Balance.He aderText = "Balance";
              >>> this.Balance.Na me = "Balance";
              >>> //
              >>> // commentsDataGri dViewTextBoxCol umn
              >>> //
              >>> this.commentsDa taGridViewTextB oxColumn.DataPr opertyName =
              >>>"Comments" ;
              >>> this.commentsDa taGridViewTextB oxColumn.Header Text =
              >>>"Comments" ;
              >>> this.commentsDa taGridViewTextB oxColumn.Name =
              >>>"commentsDat aGridViewTextBo xColumn";
              >>> this.commentsDa taGridViewTextB oxColumn.Visibl e = false;
              >>> this.commentsDa taGridViewTextB oxColumn.Width = 250;
              >>> //
              >>> // frmLedger
              >>> //
              >>> this.AutoScaleD imensions = new System.Drawing. SizeF(6F,
              >>>13F);
              >>> this.AutoScaleM ode =
              >>>System.Windo ws.Forms.AutoSc aleMode.Font;
              >>> this.ClientSize = new System.Drawing. Size(488, 199);
              >>> this.Controls.A dd(this.dgvLedg er);
              >>> this.Controls.A dd(this.statLed ger);
              >>> this.FormBorder Style =
              >>>System.Windo ws.Forms.FormBo rderStyle.Fixed Dialog;
              >>> this.Icon =
              >>>((System.Dra wing.Icon)(reso urces.GetObject ("$this.Icon")) );
              >>> this.MaximizeBo x = false;
              >>> this.Name = "frmLedger" ;
              >>> this.Text = "Ledger";
              >>> this.Load += new System.EventHan dler(this.frmLe dger_Load);
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.dgvLedge r)).EndInit();
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.awanaDat aSet)).EndInit( );
              >>>>
              >>>((System.Com ponentModel.ISu pportInitialize )(this.LedgerBS )).EndInit();
              >>> this.ResumeLayo ut(false);
              >>> this.PerformLay out();
              >>>>
              >>> }
              >>>>
              >>> #endregion
              >>>>
              >>> private System.Windows. Forms.StatusStr ip statLedger;
              >>> private System.Windows. Forms.DataGridV iew dgvLedger;
              >>> private AwanaDataSet awanaDataSet;
              >>> private System.Windows. Forms.BindingSo urce LedgerBS;
              >>> private ACRMS.AwanaData SetTableAdapter s.LedgerTableAd apter
              >>>LedgerTA;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>iDDataGridVi ewTextBoxColumn ;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>aDateDataGri dViewTextBoxCol umn;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>descriptionD ataGridViewText BoxColumn;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>debitDataGri dViewTextBoxCol umn;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>creditDataGr idViewTextBoxCo lumn;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n Balance;
              >>> private System.Windows. Forms.DataGridV iewTextBoxColum n
              >>>commentsData GridViewTextBox Column;
              >>> }
              >>>}
              >>>>
              >>>I've had this minimal code load the table in prior versions of both VB
              >>>as
              >>>well as C#. At this stage I've done no more than insure the table is
              >>>correctly loaded before proceeding further. One record exists in this
              >>>table
              >>>and it is not loaded. The bindingNav is actually greyed out and record
              >>>count
              >>>is 0.
              >>>>
              >>>This is the data in the table to be loaded.
              >>>>
              >>>"ID","ADate" ,"Description", "Debit","Credit ","Comments "
              >>>1,10/3/2008 0:00:00,"Dues", $67.00,$0.00,
              >>>>
              >>>>
              >>>"Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu mwrote
              >>>in
              >>>message news:26CAF77B-3A19-4A58-A119-2A454C528528@mi crosoft.com...
              >>>>Post your code with sample data.
              >>>>>
              >>>>--
              >>>>Regards,
              >>>>Alvin Bruney
              >>>>>
              >>>>Want a free copy of VS 2008 w/ MSDN premium subscription?
              >>>>Details at http://msmvps.com/blogs/alvin/Default.aspx
              >>>>>
              >>>>Auther Plug
              >>>>OWC Blackbook now on download at www.lulu.com/owc
              >>>>>
              >>>>"Wesley Peace" <WesleyPeace@ho tmail.comwrote in message
              >>>>news:Oqo$bb 6KJHA.1160@TK2M SFTNGP05.phx.gb l...
              >>>>>I hate to cross post, but I've gotten no answer yet on a problem I'm
              >>>>>having with visual studio 2008.
              >>>>>>
              >>>>>I've created a series of forms with controls to access a Access
              >>>>>database
              >>>>>tables. The connection string works fine and the tables are added to
              >>>>>the
              >>>>>project without a problem.
              >>>>>>
              >>>>>When I create the tables they appear to bind and I am able to preview
              >>>>>the
              >>>>>data in the database in design mode; however, at runtime no data is
              >>>>>displaye d and the dataviewgrids don't allow me to update the tables.
              >>>>>>
              >>>>>I'm currently using C#, but have tried the same application in Visual
              >>>>>Basic with the same results.
              >>>>>>
              >>>>>I've also tried re-creating the application (at least one of the
              >>>>>windows
              >>>>>forms) on a different computer with the same results. Not able to
              >>>>>display
              >>>>>the access tables.. As well as with SSCE as the data source.
              >>>>>>
              >>>>>I've checked MSDN and stepped through the Walkthroughs with no
              >>>>>success.
              >>>>>>
              >>>>>Has anyone else seen this problem or provide me some guidance.
              >>>>>
              >>>>
              >>

              Comment

              Working...