Yes, the last Adventureworks for download is not right for the 101 data samples. In the CreatingMasterDetails sample the employeeTableAdapter is using the next select: SELECT EmployeeID, ContactID, DepartmentID, ManagerID, Title, BaseRate, CurrentFlag FROM HumanResources.Employee
Such select is giving error because both DepartmentID and BaseRate are not columns of Employee table.
Now the DepartmentID column is in the EmployeeDepartmentHistory, so you need to relate the Employee, EmployeeDepartmentHistory and Department tables to obtain the functionality of the sample.
But the change is not easy, as you need to change also the datasets and the code.
So the solution is that somebody from the 101 samples development look for the old AdventureWorks and place in in the download page of the 101 samples.
Are there any scripts which accompany the samples.
What I mean is that usually databases comes with specific users accounts which are allowed to access the database and these user account and the roles may be defined in some scripts external to the database.
Can you post the URL to download these and I will check them out if there are any workarounds.
I succeded running the CreatingMasterDetails sample doing the next:
1) Using the DataBase Explorer (Open Table Definition), I have added the next two columns to Employee table: DepartmentID smallints Allownulls=true BaseRate money Allownulls=true
2) Using the DataBase Explorer upadate the column DepartmentID with values (1,2,...to 16), according to Department table values
.employeeTableAdapter.Fill(Me.adventureWorks_DataDataSet.Employee) ' TODO: This line of code loads data into the 'adventureWorks_DataDataSet.Department' table. You can move, or remove it, as needed. Me.departmentTableAdapter.Fill(Me.adventureWorks_DataDataSet.Department)
yep. pretty sure i have installed everything i need:
vb 2005 express sql 2005 .net 2.0
is there a walkthorugh for getting the above to work somewhere have had a good look around but can't find anything...
i have tried to run 101\vb forms\creating masterdetails by setting a connection to the the adventureworks_db which is instaled in the default location :
If you can see the fields in the databases, then it's definately not a connectivity issue. Maybe there's multiple versions of the database, or the project has a db file in it's folder.
I am getting the same error. I take it that the database and the sample app don't work together as the database is missing those two columns for that table. If anyone knows a fix, I'm listening.
adventure works and 101 Sample files
Andrei Azzopardi
Can you pull data from other columns out of the database
James Coleman
In the CreatingMasterDetails sample the employeeTableAdapter is using the next select:
SELECT EmployeeID, ContactID, DepartmentID, ManagerID, Title, BaseRate, CurrentFlag FROM HumanResources.Employee
Such select is giving error because both DepartmentID and BaseRate are not columns of Employee table.
Now the DepartmentID column is in the EmployeeDepartmentHistory, so you need to relate the Employee, EmployeeDepartmentHistory and Department tables to obtain the functionality of the sample.
But the change is not easy, as you need to change also the datasets and the code.
So the solution is that somebody from the 101 samples development look for the old AdventureWorks and place in in the download page of the 101 samples.
quilty
Comparing the database tables to the dataset it is clear that the Sample Application was built against a different Adventure Works database.
The new Adventure Works database has broken out several Employee attributes into seperate temporal tables.
More and more of what I see is that I am working with a released product with beta samples and documentation.
Gobo
What I mean is that usually databases comes with specific users accounts which are allowed to access the database and these user account and the roles may be defined in some scripts external to the database.
Can you post the URL to download these and I will check them out if there are any workarounds.
John Thomas
I succeded running the CreatingMasterDetails sample doing the next:
1) Using the DataBase Explorer (Open Table Definition), I have added the next two columns to Employee table:
DepartmentID smallints Allownulls=true
BaseRate money Allownulls=true
2) Using the DataBase Explorer upadate the column DepartmentID with values (1,2,...to 16), according to Department table values
3) In Form1_Load of Form1 I add the instruction:
Me.adventureWorks_DataDataSet.EnforceConstraints = False
before to fill the tables:
Me
.employeeTableAdapter.Fill(Me.adventureWorks_DataDataSet.Employee) ' TODO: This line of code loads data into the 'adventureWorks_DataDataSet.Department' table. You can move, or remove it, as needed. Me.departmentTableAdapter.Fill(Me.adventureWorks_DataDataSet.Department)xiangli
vb 2005 express
sql 2005
.net 2.0
is there a walkthorugh for getting the above to work somewhere have had a good look around but can't find anything...
i have tried to run 101\vb forms\creating masterdetails by setting a connection to the the adventureworks_db which is instaled in the default location :
"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data"
when i run the project, i get the following error:
"sqlexception was unhandled
Invalid column name 'DepartmentID'.
Invalid column name 'BaseRate'."
when i click on "general help" for this error, i get the following:
Make sure that the credentials you are supplying are valid. For more information, see How to: Access SQL Server Using Predetermined Credentials.
Make sure that you are using the correct server name, and that the server can be reached. For more information, see How to: Create Connections to SQL Server Databases.
Eusebiu
Maybe there's multiple versions of the database, or the project has a db file in it's folder.
You'd think training material would be easy
Dustin
Dragan Panjkov
NickBub
janko
in the masterdetail dataset there are fields referenced that don't correspond to fields in the table in the database.
so..that makes me think that the adventureworksDB and the 101 sample code are incompatible !
must be doing something wrong but no idea what..