vstudio data access problems

  • Thread starter Thread starter Wesley Peace
  • Start date Start date
W

Wesley Peace

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.
 
Thanks.


===> frmMain.cs

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

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

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

private void miFormsRegister_Click(object sender, EventArgs e)
{
// frmRegister Registration = new frmRegister();
frmRegistration Registration = new frmRegistration();
Registration.MdiParent = this;
Registration.Show();

}

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

private void miFormsLedger_Click(object sender, EventArgs e)
{
frmLedger Ledger = new frmLedger(); ;
Ledger.MdiParent = this;
Ledger.Show();
}
}
}

====> frmLedger.cs

sing System;
using System.Collections.Generic;
using System.ComponentModel;
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()
{
InitializeComponent();
}

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.Fill(this.awanaDataSet.Ledger);

}
}
}

===>frmLedger.Designer.cs
namespace ACRMS
{
partial class frmLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer 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.Dispose();
}
base.Dispose(disposing);
}

#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 InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(frmLedger));
this.statLedger = new System.Windows.Forms.StatusStrip();
this.dgvLedger = new System.Windows.Forms.DataGridView();
this.awanaDataSet = new ACRMS.AwanaDataSet();
this.LedgerBS = new
System.Windows.Forms.BindingSource(this.components);
this.LedgerTA = new
ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter();
this.iDDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.aDateDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.descriptionDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.debitDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.creditDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.Balance = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.commentsDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).BeginInit();
this.SuspendLayout();
//
// 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 = "statusStrip1";
//
// dgvLedger
//
this.dgvLedger.AutoGenerateColumns = false;
this.dgvLedger.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLedger.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
this.iDDataGridViewTextBoxColumn,
this.aDateDataGridViewTextBoxColumn,
this.descriptionDataGridViewTextBoxColumn,
this.debitDataGridViewTextBoxColumn,
this.creditDataGridViewTextBoxColumn,
this.Balance,
this.commentsDataGridViewTextBoxColumn});
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.awanaDataSet.DataSetName = "AwanaDataSet";
this.awanaDataSet.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// LedgerBS
//
this.LedgerBS.DataMember = "Ledger";
this.LedgerBS.DataSource = this.awanaDataSet;
//
// LedgerTA
//
this.LedgerTA.ClearBeforeFill = true;
//
// iDDataGridViewTextBoxColumn
//
this.iDDataGridViewTextBoxColumn.DataPropertyName = "ID";
this.iDDataGridViewTextBoxColumn.HeaderText = "ID";
this.iDDataGridViewTextBoxColumn.Name =
"iDDataGridViewTextBoxColumn";
this.iDDataGridViewTextBoxColumn.Visible = false;
//
// aDateDataGridViewTextBoxColumn
//
this.aDateDataGridViewTextBoxColumn.DataPropertyName = "ADate";
dataGridViewCellStyle1.Format = "d";
dataGridViewCellStyle1.NullValue = null;
this.aDateDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle1;
this.aDateDataGridViewTextBoxColumn.HeaderText = "Date";
this.aDateDataGridViewTextBoxColumn.Name =
"aDateDataGridViewTextBoxColumn";
this.aDateDataGridViewTextBoxColumn.Width = 75;
//
// descriptionDataGridViewTextBoxColumn
//
this.descriptionDataGridViewTextBoxColumn.DataPropertyName =
"Description";
this.descriptionDataGridViewTextBoxColumn.HeaderText =
"Description";
this.descriptionDataGridViewTextBoxColumn.Name =
"descriptionDataGridViewTextBoxColumn";
this.descriptionDataGridViewTextBoxColumn.Width = 150;
//
// debitDataGridViewTextBoxColumn
//
this.debitDataGridViewTextBoxColumn.DataPropertyName = "Debit";
dataGridViewCellStyle2.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Format = "N2";
dataGridViewCellStyle2.NullValue = "0";
this.debitDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle2;
this.debitDataGridViewTextBoxColumn.HeaderText = "Debit";
this.debitDataGridViewTextBoxColumn.Name =
"debitDataGridViewTextBoxColumn";
this.debitDataGridViewTextBoxColumn.Resizable =
System.Windows.Forms.DataGridViewTriState.False;
this.debitDataGridViewTextBoxColumn.Width = 60;
//
// creditDataGridViewTextBoxColumn
//
this.creditDataGridViewTextBoxColumn.DataPropertyName =
"Credit";
dataGridViewCellStyle3.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle3.Format = "N2";
dataGridViewCellStyle3.NullValue = "0";
this.creditDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle3;
this.creditDataGridViewTextBoxColumn.HeaderText = "Credit";
this.creditDataGridViewTextBoxColumn.Name =
"creditDataGridViewTextBoxColumn";
this.creditDataGridViewTextBoxColumn.Width = 60;
//
// Balance
//
dataGridViewCellStyle4.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle4.Format = "N2";
dataGridViewCellStyle4.NullValue = "0";
this.Balance.DefaultCellStyle = dataGridViewCellStyle4;
this.Balance.HeaderText = "Balance";
this.Balance.Name = "Balance";
//
// commentsDataGridViewTextBoxColumn
//
this.commentsDataGridViewTextBoxColumn.DataPropertyName =
"Comments";
this.commentsDataGridViewTextBoxColumn.HeaderText = "Comments";
this.commentsDataGridViewTextBoxColumn.Name =
"commentsDataGridViewTextBoxColumn";
this.commentsDataGridViewTextBoxColumn.Visible = false;
this.commentsDataGridViewTextBoxColumn.Width = 250;
//
// frmLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 199);
this.Controls.Add(this.dgvLedger);
this.Controls.Add(this.statLedger);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon =
((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmLedger";
this.Text = "Ledger";
this.Load += new System.EventHandler(this.frmLedger_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.StatusStrip statLedger;
private System.Windows.Forms.DataGridView dgvLedger;
private AwanaDataSet awanaDataSet;
private System.Windows.Forms.BindingSource LedgerBS;
private ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter LedgerTA;
private System.Windows.Forms.DataGridViewTextBoxColumn
iDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
aDateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
descriptionDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
debitDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
creditDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Balance;
private System.Windows.Forms.DataGridViewTextBoxColumn
commentsDataGridViewTextBoxColumn;
}
}

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,
 
:'-]

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 said:
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 said:
Thanks.


===> frmMain.cs

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

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

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

private void miFormsRegister_Click(object sender, EventArgs e)
{
// frmRegister Registration = new frmRegister();
frmRegistration Registration = new frmRegistration();
Registration.MdiParent = this;
Registration.Show();

}

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

private void miFormsLedger_Click(object sender, EventArgs e)
{
frmLedger Ledger = new frmLedger(); ;
Ledger.MdiParent = this;
Ledger.Show();
}
}
}

====> frmLedger.cs

sing System;
using System.Collections.Generic;
using System.ComponentModel;
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()
{
InitializeComponent();
}

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.Fill(this.awanaDataSet.Ledger);

}
}
}

===>frmLedger.Designer.cs
namespace ACRMS
{
partial class frmLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer 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.Dispose();
}
base.Dispose(disposing);
}

#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 InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle1 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle2 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle3 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle4 = new
System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(frmLedger));
this.statLedger = new System.Windows.Forms.StatusStrip();
this.dgvLedger = new System.Windows.Forms.DataGridView();
this.awanaDataSet = new ACRMS.AwanaDataSet();
this.LedgerBS = new
System.Windows.Forms.BindingSource(this.components);
this.LedgerTA = new
ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter();
this.iDDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.aDateDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.descriptionDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.debitDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.creditDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.Balance = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.commentsDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).BeginInit();
this.SuspendLayout();
//
// 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 = "statusStrip1";
//
// dgvLedger
//
this.dgvLedger.AutoGenerateColumns = false;
this.dgvLedger.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLedger.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
this.iDDataGridViewTextBoxColumn,
this.aDateDataGridViewTextBoxColumn,
this.descriptionDataGridViewTextBoxColumn,
this.debitDataGridViewTextBoxColumn,
this.creditDataGridViewTextBoxColumn,
this.Balance,
this.commentsDataGridViewTextBoxColumn});
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.awanaDataSet.DataSetName = "AwanaDataSet";
this.awanaDataSet.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// LedgerBS
//
this.LedgerBS.DataMember = "Ledger";
this.LedgerBS.DataSource = this.awanaDataSet;
//
// LedgerTA
//
this.LedgerTA.ClearBeforeFill = true;
//
// iDDataGridViewTextBoxColumn
//
this.iDDataGridViewTextBoxColumn.DataPropertyName = "ID";
this.iDDataGridViewTextBoxColumn.HeaderText = "ID";
this.iDDataGridViewTextBoxColumn.Name =
"iDDataGridViewTextBoxColumn";
this.iDDataGridViewTextBoxColumn.Visible = false;
//
// aDateDataGridViewTextBoxColumn
//
this.aDateDataGridViewTextBoxColumn.DataPropertyName =
"ADate";
dataGridViewCellStyle1.Format = "d";
dataGridViewCellStyle1.NullValue = null;
this.aDateDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle1;
this.aDateDataGridViewTextBoxColumn.HeaderText = "Date";
this.aDateDataGridViewTextBoxColumn.Name =
"aDateDataGridViewTextBoxColumn";
this.aDateDataGridViewTextBoxColumn.Width = 75;
//
// descriptionDataGridViewTextBoxColumn
//
this.descriptionDataGridViewTextBoxColumn.DataPropertyName =
"Description";
this.descriptionDataGridViewTextBoxColumn.HeaderText =
"Description";
this.descriptionDataGridViewTextBoxColumn.Name =
"descriptionDataGridViewTextBoxColumn";
this.descriptionDataGridViewTextBoxColumn.Width = 150;
//
// debitDataGridViewTextBoxColumn
//
this.debitDataGridViewTextBoxColumn.DataPropertyName =
"Debit";
dataGridViewCellStyle2.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Format = "N2";
dataGridViewCellStyle2.NullValue = "0";
this.debitDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle2;
this.debitDataGridViewTextBoxColumn.HeaderText = "Debit";
this.debitDataGridViewTextBoxColumn.Name =
"debitDataGridViewTextBoxColumn";
this.debitDataGridViewTextBoxColumn.Resizable =
System.Windows.Forms.DataGridViewTriState.False;
this.debitDataGridViewTextBoxColumn.Width = 60;
//
// creditDataGridViewTextBoxColumn
//
this.creditDataGridViewTextBoxColumn.DataPropertyName =
"Credit";
dataGridViewCellStyle3.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle3.Format = "N2";
dataGridViewCellStyle3.NullValue = "0";
this.creditDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle3;
this.creditDataGridViewTextBoxColumn.HeaderText = "Credit";
this.creditDataGridViewTextBoxColumn.Name =
"creditDataGridViewTextBoxColumn";
this.creditDataGridViewTextBoxColumn.Width = 60;
//
// Balance
//
dataGridViewCellStyle4.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle4.Format = "N2";
dataGridViewCellStyle4.NullValue = "0";
this.Balance.DefaultCellStyle = dataGridViewCellStyle4;
this.Balance.HeaderText = "Balance";
this.Balance.Name = "Balance";
//
// commentsDataGridViewTextBoxColumn
//
this.commentsDataGridViewTextBoxColumn.DataPropertyName =
"Comments";
this.commentsDataGridViewTextBoxColumn.HeaderText =
"Comments";
this.commentsDataGridViewTextBoxColumn.Name =
"commentsDataGridViewTextBoxColumn";
this.commentsDataGridViewTextBoxColumn.Visible = false;
this.commentsDataGridViewTextBoxColumn.Width = 250;
//
// frmLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 199);
this.Controls.Add(this.dgvLedger);
this.Controls.Add(this.statLedger);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon =
((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmLedger";
this.Text = "Ledger";
this.Load += new System.EventHandler(this.frmLedger_Load);

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.StatusStrip statLedger;
private System.Windows.Forms.DataGridView dgvLedger;
private AwanaDataSet awanaDataSet;
private System.Windows.Forms.BindingSource LedgerBS;
private ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter
LedgerTA;
private System.Windows.Forms.DataGridViewTextBoxColumn
iDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
aDateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
descriptionDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
debitDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
creditDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Balance;
private System.Windows.Forms.DataGridViewTextBoxColumn
commentsDataGridViewTextBoxColumn;
}
}

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 m> wrote
in
message news:[email protected]...
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

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.
 
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 said:
:'-]

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 said:
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 said:
Thanks.


===> frmMain.cs

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

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

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

private void miFormsRegister_Click(object sender, EventArgs e)
{
// frmRegister Registration = new frmRegister();
frmRegistration Registration = new frmRegistration();
Registration.MdiParent = this;
Registration.Show();

}

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

private void miFormsLedger_Click(object sender, EventArgs e)
{
frmLedger Ledger = new frmLedger(); ;
Ledger.MdiParent = this;
Ledger.Show();
}
}
}

====> frmLedger.cs

sing System;
using System.Collections.Generic;
using System.ComponentModel;
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()
{
InitializeComponent();
}

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.Fill(this.awanaDataSet.Ledger);

}
}
}

===>frmLedger.Designer.cs
namespace ACRMS
{
partial class frmLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer 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.Dispose();
}
base.Dispose(disposing);
}

#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 InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle1 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle2 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle3 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle4 = new
System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources =
new
System.ComponentModel.ComponentResourceManager(typeof(frmLedger));
this.statLedger = new System.Windows.Forms.StatusStrip();
this.dgvLedger = new System.Windows.Forms.DataGridView();
this.awanaDataSet = new ACRMS.AwanaDataSet();
this.LedgerBS = new
System.Windows.Forms.BindingSource(this.components);
this.LedgerTA = new
ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter();
this.iDDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.aDateDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.descriptionDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.debitDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.creditDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.Balance = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.commentsDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).BeginInit();
this.SuspendLayout();
//
// 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 = "statusStrip1";
//
// dgvLedger
//
this.dgvLedger.AutoGenerateColumns = false;
this.dgvLedger.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLedger.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
this.iDDataGridViewTextBoxColumn,
this.aDateDataGridViewTextBoxColumn,
this.descriptionDataGridViewTextBoxColumn,
this.debitDataGridViewTextBoxColumn,
this.creditDataGridViewTextBoxColumn,
this.Balance,
this.commentsDataGridViewTextBoxColumn});
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.awanaDataSet.DataSetName = "AwanaDataSet";
this.awanaDataSet.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// LedgerBS
//
this.LedgerBS.DataMember = "Ledger";
this.LedgerBS.DataSource = this.awanaDataSet;
//
// LedgerTA
//
this.LedgerTA.ClearBeforeFill = true;
//
// iDDataGridViewTextBoxColumn
//
this.iDDataGridViewTextBoxColumn.DataPropertyName = "ID";
this.iDDataGridViewTextBoxColumn.HeaderText = "ID";
this.iDDataGridViewTextBoxColumn.Name =
"iDDataGridViewTextBoxColumn";
this.iDDataGridViewTextBoxColumn.Visible = false;
//
// aDateDataGridViewTextBoxColumn
//
this.aDateDataGridViewTextBoxColumn.DataPropertyName =
"ADate";
dataGridViewCellStyle1.Format = "d";
dataGridViewCellStyle1.NullValue = null;
this.aDateDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle1;
this.aDateDataGridViewTextBoxColumn.HeaderText = "Date";
this.aDateDataGridViewTextBoxColumn.Name =
"aDateDataGridViewTextBoxColumn";
this.aDateDataGridViewTextBoxColumn.Width = 75;
//
// descriptionDataGridViewTextBoxColumn
//
this.descriptionDataGridViewTextBoxColumn.DataPropertyName =
"Description";
this.descriptionDataGridViewTextBoxColumn.HeaderText =
"Description";
this.descriptionDataGridViewTextBoxColumn.Name =
"descriptionDataGridViewTextBoxColumn";
this.descriptionDataGridViewTextBoxColumn.Width = 150;
//
// debitDataGridViewTextBoxColumn
//
this.debitDataGridViewTextBoxColumn.DataPropertyName =
"Debit";
dataGridViewCellStyle2.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Format = "N2";
dataGridViewCellStyle2.NullValue = "0";
this.debitDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle2;
this.debitDataGridViewTextBoxColumn.HeaderText = "Debit";
this.debitDataGridViewTextBoxColumn.Name =
"debitDataGridViewTextBoxColumn";
this.debitDataGridViewTextBoxColumn.Resizable =
System.Windows.Forms.DataGridViewTriState.False;
this.debitDataGridViewTextBoxColumn.Width = 60;
//
// creditDataGridViewTextBoxColumn
//
this.creditDataGridViewTextBoxColumn.DataPropertyName =
"Credit";
dataGridViewCellStyle3.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle3.Format = "N2";
dataGridViewCellStyle3.NullValue = "0";
this.creditDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle3;
this.creditDataGridViewTextBoxColumn.HeaderText = "Credit";
this.creditDataGridViewTextBoxColumn.Name =
"creditDataGridViewTextBoxColumn";
this.creditDataGridViewTextBoxColumn.Width = 60;
//
// Balance
//
dataGridViewCellStyle4.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle4.Format = "N2";
dataGridViewCellStyle4.NullValue = "0";
this.Balance.DefaultCellStyle = dataGridViewCellStyle4;
this.Balance.HeaderText = "Balance";
this.Balance.Name = "Balance";
//
// commentsDataGridViewTextBoxColumn
//
this.commentsDataGridViewTextBoxColumn.DataPropertyName =
"Comments";
this.commentsDataGridViewTextBoxColumn.HeaderText =
"Comments";
this.commentsDataGridViewTextBoxColumn.Name =
"commentsDataGridViewTextBoxColumn";
this.commentsDataGridViewTextBoxColumn.Visible = false;
this.commentsDataGridViewTextBoxColumn.Width = 250;
//
// frmLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 199);
this.Controls.Add(this.dgvLedger);
this.Controls.Add(this.statLedger);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon =
((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmLedger";
this.Text = "Ledger";
this.Load += new System.EventHandler(this.frmLedger_Load);

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.StatusStrip statLedger;
private System.Windows.Forms.DataGridView dgvLedger;
private AwanaDataSet awanaDataSet;
private System.Windows.Forms.BindingSource LedgerBS;
private ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter
LedgerTA;
private System.Windows.Forms.DataGridViewTextBoxColumn
iDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
aDateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
descriptionDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
debitDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
creditDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Balance;
private System.Windows.Forms.DataGridViewTextBoxColumn
commentsDataGridViewTextBoxColumn;
}
}

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 m> wrote
in
message 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

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.
 
Yes

William Vaughn (MVP) said:
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 said:
:'-]

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 said:
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

Thanks.


===> frmMain.cs

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

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

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

private void miFormsRegister_Click(object sender, EventArgs e)
{
// frmRegister Registration = new frmRegister();
frmRegistration Registration = new frmRegistration();
Registration.MdiParent = this;
Registration.Show();

}

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

private void miFormsLedger_Click(object sender, EventArgs e)
{
frmLedger Ledger = new frmLedger(); ;
Ledger.MdiParent = this;
Ledger.Show();
}
}
}

====> frmLedger.cs

sing System;
using System.Collections.Generic;
using System.ComponentModel;
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()
{
InitializeComponent();
}

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.Fill(this.awanaDataSet.Ledger);

}
}
}

===>frmLedger.Designer.cs
namespace ACRMS
{
partial class frmLedger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer 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.Dispose();
}
base.Dispose(disposing);
}

#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 InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle1 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle2 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle3 = new
System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle
dataGridViewCellStyle4 = new
System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources =
new
System.ComponentModel.ComponentResourceManager(typeof(frmLedger));
this.statLedger = new System.Windows.Forms.StatusStrip();
this.dgvLedger = new System.Windows.Forms.DataGridView();
this.awanaDataSet = new ACRMS.AwanaDataSet();
this.LedgerBS = new
System.Windows.Forms.BindingSource(this.components);
this.LedgerTA = new
ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter();
this.iDDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.aDateDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.descriptionDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.debitDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.creditDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.Balance = new
System.Windows.Forms.DataGridViewTextBoxColumn();
this.commentsDataGridViewTextBoxColumn = new
System.Windows.Forms.DataGridViewTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).BeginInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).BeginInit();
this.SuspendLayout();
//
// 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 = "statusStrip1";
//
// dgvLedger
//
this.dgvLedger.AutoGenerateColumns = false;
this.dgvLedger.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLedger.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
this.iDDataGridViewTextBoxColumn,
this.aDateDataGridViewTextBoxColumn,
this.descriptionDataGridViewTextBoxColumn,
this.debitDataGridViewTextBoxColumn,
this.creditDataGridViewTextBoxColumn,
this.Balance,
this.commentsDataGridViewTextBoxColumn});
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.awanaDataSet.DataSetName = "AwanaDataSet";
this.awanaDataSet.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// LedgerBS
//
this.LedgerBS.DataMember = "Ledger";
this.LedgerBS.DataSource = this.awanaDataSet;
//
// LedgerTA
//
this.LedgerTA.ClearBeforeFill = true;
//
// iDDataGridViewTextBoxColumn
//
this.iDDataGridViewTextBoxColumn.DataPropertyName = "ID";
this.iDDataGridViewTextBoxColumn.HeaderText = "ID";
this.iDDataGridViewTextBoxColumn.Name =
"iDDataGridViewTextBoxColumn";
this.iDDataGridViewTextBoxColumn.Visible = false;
//
// aDateDataGridViewTextBoxColumn
//
this.aDateDataGridViewTextBoxColumn.DataPropertyName =
"ADate";
dataGridViewCellStyle1.Format = "d";
dataGridViewCellStyle1.NullValue = null;
this.aDateDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle1;
this.aDateDataGridViewTextBoxColumn.HeaderText = "Date";
this.aDateDataGridViewTextBoxColumn.Name =
"aDateDataGridViewTextBoxColumn";
this.aDateDataGridViewTextBoxColumn.Width = 75;
//
// descriptionDataGridViewTextBoxColumn
//
this.descriptionDataGridViewTextBoxColumn.DataPropertyName =
"Description";
this.descriptionDataGridViewTextBoxColumn.HeaderText =
"Description";
this.descriptionDataGridViewTextBoxColumn.Name =
"descriptionDataGridViewTextBoxColumn";
this.descriptionDataGridViewTextBoxColumn.Width = 150;
//
// debitDataGridViewTextBoxColumn
//
this.debitDataGridViewTextBoxColumn.DataPropertyName =
"Debit";
dataGridViewCellStyle2.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Format = "N2";
dataGridViewCellStyle2.NullValue = "0";
this.debitDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle2;
this.debitDataGridViewTextBoxColumn.HeaderText = "Debit";
this.debitDataGridViewTextBoxColumn.Name =
"debitDataGridViewTextBoxColumn";
this.debitDataGridViewTextBoxColumn.Resizable =
System.Windows.Forms.DataGridViewTriState.False;
this.debitDataGridViewTextBoxColumn.Width = 60;
//
// creditDataGridViewTextBoxColumn
//
this.creditDataGridViewTextBoxColumn.DataPropertyName =
"Credit";
dataGridViewCellStyle3.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle3.Format = "N2";
dataGridViewCellStyle3.NullValue = "0";
this.creditDataGridViewTextBoxColumn.DefaultCellStyle =
dataGridViewCellStyle3;
this.creditDataGridViewTextBoxColumn.HeaderText = "Credit";
this.creditDataGridViewTextBoxColumn.Name =
"creditDataGridViewTextBoxColumn";
this.creditDataGridViewTextBoxColumn.Width = 60;
//
// Balance
//
dataGridViewCellStyle4.Alignment =
System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle4.Format = "N2";
dataGridViewCellStyle4.NullValue = "0";
this.Balance.DefaultCellStyle = dataGridViewCellStyle4;
this.Balance.HeaderText = "Balance";
this.Balance.Name = "Balance";
//
// commentsDataGridViewTextBoxColumn
//
this.commentsDataGridViewTextBoxColumn.DataPropertyName =
"Comments";
this.commentsDataGridViewTextBoxColumn.HeaderText =
"Comments";
this.commentsDataGridViewTextBoxColumn.Name =
"commentsDataGridViewTextBoxColumn";
this.commentsDataGridViewTextBoxColumn.Visible = false;
this.commentsDataGridViewTextBoxColumn.Width = 250;
//
// frmLedger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 199);
this.Controls.Add(this.dgvLedger);
this.Controls.Add(this.statLedger);
this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon =
((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "frmLedger";
this.Text = "Ledger";
this.Load += new System.EventHandler(this.frmLedger_Load);

((System.ComponentModel.ISupportInitialize)(this.dgvLedger)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.awanaDataSet)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.LedgerBS)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.StatusStrip statLedger;
private System.Windows.Forms.DataGridView dgvLedger;
private AwanaDataSet awanaDataSet;
private System.Windows.Forms.BindingSource LedgerBS;
private ACRMS.AwanaDataSetTableAdapters.LedgerTableAdapter
LedgerTA;
private System.Windows.Forms.DataGridViewTextBoxColumn
iDDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
aDateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
descriptionDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
debitDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn
creditDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Balance;
private System.Windows.Forms.DataGridViewTextBoxColumn
commentsDataGridViewTextBoxColumn;
}
}

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 m> wrote
in
message 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

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.
 
Back
Top