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?
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?