473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Could not load type System.Web.UI.WebControls.AccessDataSource fromassembly System.Web, Version=1.0.5000.0

DC
Why would this code give me the error

"Could not load type System.Web.UI.WebControls.AccessDataSource from
assembly System.Web, Version=1.0.5000.0" at line 16...

<form id="form1" runat="server">
Line 15: <div>
Line 16: <asp:AccessDataSource ID="AccessDataSource1"
Runat="server" DataFile="data\pubs.mdb"
Line 17: SelectCommand="select * from [authors]"
Line 18: DeleteCommand="DELETE FROM [authors] WHERE [au_id] = ?"

I heard it might be because .net framework 2.0 is not installed
properly, so I reinstalled .net 2.0 from scratch (its on a winsows 2003
server) but to no avail.

Any idea what is going on here?
<%@ Page language="C#" %>

<%@ import namespace="System" %>
<%@ import namespace="System.Web" %>
<%@ import namespace="System.Web.UI" %>
<%@ import namespace="System.Web.UI.HtmlControls" %>
<%@ import namespace="System.Web.UI.WebControls" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Data.OleDb" %>

<script RunAt="server">

void EmployeesGridView_OnSelectedIndexChanged(Object sender, EventArgs e)
{
EmployeeDetailsSqlDataSource.SelectParameters["EmpID"].DefaultValue =
EmployeesGridView.SelectedValue.ToString();
EmployeeFormView.DataBind();
}

void EmployeeFormView_ItemUpdated(Object sender,
FormViewUpdatedEventArgs e)
{
EmployeesGridView.DataBind();
}

void EmployeeFormView_ItemDeleted(Object sender,
FormViewDeletedEventArgs e)
{
EmployeesGridView.DataBind();
}

void EmployeeDetailsSqlDataSource_OnInserted(Object sender,
SqlDataSourceStatusEventArgs e)
{
System.Data.Common.DbCommand command = e.Command;

EmployeeDetailsSqlDataSource.SelectParameters["EmpID"].DefaultValue =
command.Parameters["@EmpID"].Value.ToString();

EmployeesGridView.DataBind();
EmployeeFormView.DataBind();
}

</script>

<html>
<body>
<form RunAt="server">

<h3>FormView Example</h3>

<table cellspacing="10">

<tr>
<td>
<asp:GridView ID="EmployeesGridView"
DataSourceID="EmployeeAccessDataSource"
AutoGenerateColumns="false"
DataKeyNames="EmployeeID"

OnSelectedIndexChanged="EmployeesGridView_OnSelect edIndexChanged"
RunAt="Server">

<HeaderStyle backcolor="Navy"
forecolor="White" />

<Columns>

<asp:ButtonField Text="Details..."
HeaderText="Show<BR>Details"
CommandName="Select"/>

<asp:BoundField DataField="EmployeeID"
HeaderText="Employee ID"/>
<asp:BoundField DataField="LastName"
HeaderText="Last Name"/>
<asp:BoundField DataField="FirstName"
HeaderText="First Name"/>

</Columns>

</asp:GridView>

</td>

<td valign="top">

<asp:FormView ID="EmployeeFormView"
DataSourceID="EmployeeDetailsSqlDataSource"
DataKeyNames="EmployeeID"
Gridlines="Both"
OnItemUpdated="EmployeeFormView_ItemUpdated"
OnItemDeleted="EmployeeFormView_ItemDeleted"
RunAt="server">

<HeaderStyle backcolor="Navy"
forecolor="White"/>

<RowStyle backcolor="White"/>

<EditRowStyle backcolor="LightCyan"/>

<ItemTemplate>
<table>
<tr><td align=right><B>Employee ID:</B></td><td><%#
Eval("EmployeeID") %></td></tr>
<tr><td align=right><B>First Name:</B></td<td><%#
Eval("FirstName") %></td></tr>
<tr><td align=right><B>Last Name:</B></td <td><%#
Eval("LastName") %></td></tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="EditButton"
Text="Edit"
CommandName="Edit"
RunAt="server"/>
&nbsp;
<asp:LinkButton ID="NewButton"
Text="New"
CommandName="New"
RunAt="server"/>
&nbsp;
<asp:LinkButton ID="DeleteButton"
Text="Delete"
CommandName="Delete"
RunAt="server"/>
</td>
</tr>
</table>
</ItemTemplate>

<EditItemTemplate>
<table>
<tr><td align=right><B>Employee ID:</B></td><td><%#
Eval("EmployeeID") %></td></tr>

<tr><td align=right><B>First Name:</B></td>
<td><asp:TextBox ID="EditFirstNameTextBox"
Text='<%# Bind("FirstName") %>'
RunAt="Server" /></td></tr>

<tr><td align=right><B>Last Name:</B></td>
<td><asp:TextBox ID="EditLastNameTextBox"
Text='<%# Bind("LastName") %>'
RunAt="Server" /></td></tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="UpdateButton"
Text="Update"
CommandName="Update"
RunAt="server"/>
&nbsp;
<asp:LinkButton ID="CancelUpdateButton"
Text="Cancel"
CommandName="Cancel"
RunAt="server"/>
</td>
</tr>
</table>
</EditItemTemplate>

<InsertItemTemplate>
<table>
<tr><td align=right><B>First Name:</B></td>
<td><asp:TextBox ID="InsertFirstNameTextBox"
Text='<%# Bind("FirstName") %>'
RunAt="Server" /></td></tr>

<tr><td align=right><B>Last Name:</B></td>
<td><asp:TextBox ID="InsertLastNameTextBox"
Text='<%# Bind("LastName") %>'
RunAt="Server" /></td></tr>

<tr>
<td colspan="2">
<asp:LinkButton ID="InsertButton"
Text="Insert"
CommandName="Insert"
RunAt="server"/>
&nbsp;
<asp:LinkButton ID="CancelInsertButton"
Text="Cancel"
CommandName="Cancel"
RunAt="server"/>
</td>
</tr>
</table>
</InsertItemTemplate>

</asp:FormView>

</td>

</tr>

</table>

<asp:AccessDataSource
id="EmployeeAccessDataSource"
DataFile="~/App_Data/Northwind.mdb"
runat="server"
SelectCommand="SELECT EmployeeID, LastName, FirstName FROM
Employees WHERE EmployeeID = @EmpID"

InsertCommand="INSERT INTO Employees(LastName, FirstName)
VALUES (@LastName, @FirstName);
SELECT @EmpID = SCOPE_IDENTITY()"
UpdateCommand="UPDATE Employees SET LastName=@LastName,
FirstName=@FirstName
WHERE EmployeeID=@EmployeeID"
DeleteCommand="DELETE Employees WHERE EmployeeID=@EmployeeID"

ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
OnInserted="EmployeeDetailsSqlDataSource_OnInserte d"
connectionstring="<%$ ConnectionStrings:NorthwindConnection %>"

<SelectParameters>
<asp:Parameter Name="Beginning Date" Type="DateTime"
defaultValue="1/1/1997" />
<asp:Parameter Name="Ending Date" Type="DateTime"
defaultValue="1/31/1997" />
</SelectParameters>
</asp:AccessDataSource>
<SelectParameters>
<asp:Parameter Name="EmpID" Type="Int32" DefaultValue="0" />
</SelectParameters>

<InsertParameters>
<asp:Parameter Name="EmpID" Direction="Output" Type="Int32"
DefaultValue="0" />
</InsertParameters>

</asp:AccessDataSource>

</form>
</body>
--
_______________________________________________

DC

"You can not reason a man out of a position he did not reach through reason"

"Don't use a big word where a diminutive one will suffice."

"A man with a watch knows what time it is. A man with two watches is
never sure." Segal's Law
Jul 3 '06 #1
0 2991

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: M | last post by:
Hi There, I am having lot of trouble getting out the ASP.NET "dll hell", i hope i can find the help here. i have coded a simple page using Visual Studio compiled it. keep on getting works on my...
1
by: news.microsoft.com | last post by:
Hi, I've just finished developing an web site locally (ASP 1.1) which works fine. Now that I have posted it to our server (which has 1.0 and 1.1 installed) I get the following error message when...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
2
by: Kevin R. | last post by:
I have been ignoring this problem for a few weeks now, but it's becoming a bit annoying not to mention unproductive. Here it goes: I compile my project with no errors. Then after I debug/run it,...
0
by: qiang | last post by:
Hi everyone, Could you please take a look at an exception for ASP.NET application? My ASP.NET application is using Infragistics WebChart control. I encounter an exception below when...
2
by: =?Utf-8?B?QWlyRHVzdGVyMTAx?= | last post by:
Hi, I am using the menu control on my aspx pages. Everything works fine on my notebook but after I published my pages to the web server. I got this error. I've installed .netframework 2.0 but...
1
by: Allan Ebdrup | last post by:
I have a asp.net v2 website that runs fine on our development server. I have published the website to a stage server and it runs fine, but when I publish it to production I get the following error:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.