Building a Dataset with Access

  • Thread starter Thread starter Curt Emich
  • Start date Start date
C

Curt Emich

I have another question about this process of getting a connection set up
and then populating a drop-down list box with a query.

I was able to create a connection like you said, and then I created a data
adapter. I then clicked on "generate dataset" and named a dataset to be
created from a query I specified. I get this build error:

"The type or namespace name 'dsStatements' does not exist in the class or
namespace 'TrainOfThought.TrainOfThought' (are you missing an assembly
reference?)"

"dsStatements", of course, is the name of the dataset. "TrainOfThought" is
the name of the application and the namespace and the main class. The code
doesn't seem to generate a dataset object. Instead, I get this code at the
top of the "TrainOfThought" class:

protected System.Data.OleDb.OleDbConnection cnnTrainOfThought;

protected System.Data.OleDb.OleDbCommand oleDbInsertCommand1;

protected System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;

protected System.Data.OleDb.OleDbCommand oleDbDeleteCommand1;

protected System.Data.OleDb.OleDbDataAdapter adaStatements;

protected System.Data.OleDb.OleDbCommand cmdSelectStatements;

protected TrainOfThought.dsStatements dsStatements1;

protected System.Web.UI.WebControls.DropDownList DropDownList1;


The second to last line is the problem. I can't see why it's generated the
way it is. I would expect it to come from System.Data.Dataset, not
"TrainOfThought.dsStatements". Does anyone know what I'm doing wrong here
or how I can work around it?
 
Here is the problem. I deleted the dataset and any references to it. Then generated a new dataset with the insert etc optio

Heres is what it wrote
Protected WithEvents DsSurvey1 As guestbook.dsSurvey <-- syntax erro
guestbook is the name of the Table when I rebuild I ge
error BC30002: Type 'guestbook.dsSurvey' is not defined
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter(
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand(
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection(
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand(
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand(
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand(
Me.DsSurvey1 = New guestbook.dsSurvey() <-- syntax erro
error BC30002: Type 'guestbook.dsSurvey' is not defined.
CType(Me.DsSurvey1, System.ComponentModel.ISupportInitialize).BeginInit(

If I re-define the dataset as dsSurvey I then get a 'not in the parmeters Collection' message with I run in the browser
I checked the assembly file nothing going on in there.
I am working in the Vs.net IDE. I have seen samples but they always seem to wirte the code in the aspx file rather then the aspx.vb code behind so I am sort of stumped. I wish I could get my hands on a Web form project that had the insert,update delete already setup. Then I could see how is to be declared and could handle this type of situation.
 
Back
Top