473,405 Members | 2,279 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,405 software developers and data experts.

asp.net issue with updating records

1
The issue is this. Have one table with two others related to it. Now I use the others to display the proper names in the field, which there indexes are stored in the table I want to update the data in. How can I update the data in the main table? Code Follows:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="upd_component.aspx.vb" Inherits="upd_component" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Value="not selected">select a component type</asp:ListItem>
<asp:ListItem>Video Card</asp:ListItem>
<asp:ListItem>Memory</asp:ListItem>
<asp:ListItem>Net Card</asp:ListItem>
<asp:ListItem>Hard Drive</asp:ListItem>
<asp:ListItem>Optical Drive</asp:ListItem>
<asp:ListItem>Processor</asp:ListItem>
<asp:ListItem>Monitor</asp:ListItem>
</asp:DropDownList><br />
&nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:inventoryDBConnectionString2 %>"
SelectCommand="SELECT Hardrive.model, Hardrive.capacity, Type.name, Manufacturer.name AS Expr1 FROM Hardrive INNER JOIN Manufacturer ON Hardrive.man_id = Manufacturer.man_id INNER JOIN Type ON Hardrive.hd_type_id = Type.type_id" UpdateCommand="UPDATE Hardrive SET capacity = @capacity, model = @model, man_id = Manufacturer.man_id, hd_type_id = Type.type_id FROM Hardrive INNER JOIN Manufacturer ON Hardrive.man_id = Manufacturer.man_id INNER JOIN Type ON Hardrive.hd_type_id = Type.type_id WHERE (Manufacturer.name = @Expr1)">
<UpdateParameters>
<asp:Parameter Name="capacity" />
<asp:Parameter Name="model" />
<asp:Parameter Name="Expr1" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
Height="50px" Width="616px" AllowPaging="True" Visible="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" AutoGenerateInsertButton="True">
<EmptyDataTemplate>
No data is present
</EmptyDataTemplate>
<Fields>
<asp:BoundField DataField="Expr1" HeaderText="Manufacturer" SortExpression="Expr1" />
<asp:BoundField DataField="model" HeaderText="Model" SortExpression="model" >
<HeaderStyle Font-Bold="True" />
</asp:BoundField>
<asp:BoundField DataField="capacity" HeaderText="Capacity (gigs)" SortExpression="capacity" />
<asp:BoundField DataField="name" HeaderText="Type of Connection" SortExpression="name" />
</Fields>
</asp:DetailsView>
&nbsp; &nbsp;
</form>
</body>
</html>
Jul 12 '06 #1
0 1714

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
1
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds...
0
by: | last post by:
I am updating MS access tables with data in an xml document. I create two dataset, one for existing data and one for new data. I fill the first dataset with the records from MS Access, the second...
1
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass...
3
by: LDD | last post by:
Hi Folks I've recently upgraded an app from vb6 to vb.net I've run into an issue where it takes about 15-20 times longer to write 1000 records to an MS Access database. (I'm sure it takes that...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
11
by: =?Utf-8?B?R29rdWw=?= | last post by:
I am struck up with a problem and want anyone here to help me out. I am a beginner in .NET trying to learng DataBinding concepts. I have binded 4 text boxes with a dataset but when I say...
10
by: chimambo | last post by:
Hi All, I have a little problem. I am retrieving records from a table and I want to update the records using checkboxes. I am able to display the database record quite alright and I have created...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.