473,657 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to update a gridview asp.net 2.0

Hi

I am trying to update via an datagrid only nothing seems to happen
how would I diplay what the update query looks like msgbox
reponse.write? where do I put em?

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">
void DetailsView1_It emUpdated(Objec t sender,
DetailsViewUpda tedEventArgs e)
{
GridView1.DataB ind();
}
void DetailsView1_It emInserted(Obje ct sender,
DetailsViewInse rtedEventArgs e)
{
GridView1.DataB ind();
}
void DetailsView1_It emDeleted(Objec t sender,
DetailsViewDele tedEventArgs e)
{
GridView1.DataB ind();
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Editin g Access Database</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:AccessData Source ID="AccessDataS ource1" Runat="server"
DataFile="data\ pubs.mdb"
SelectCommand=" select * from [authors],[books] where au_id
= author_key" >
</asp:AccessDataS ource>
<asp:GridView ID="GridView1" Runat="server" AllowPaging="Tr ue"
AllowSorting="T rue" DataSourceID="A ccessDataSource 1"
DataKeyNames="a u_id" AutoGenerateSel ectButton="True ">
</asp:GridView>
<asp:AccessData Source ID="AccessDataS ource2" Runat="server"
DataFile="data\ pubs.mdb"
SelectCommand=" select * from [authors],[books] where au_id
= author_key"
DeleteCommand=" DELETE FROM [authors] WHERE [au_id] = ?"
UpdateCommand=" UPDATE [books] SET [book_title] = ? WHERE
[author_key] = ?"
InsertCommand=" INSERT INTO [authors] ([au_id], [au_lname],
[au_fname], [phone], [address], [city], [state], [zip], [contract],
[author_key], [book_title]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
FilterExpressio n="au_id='@au_i d'">
<FilterParamete rs>
<asp:ControlPar ameter Name="au_id"
ControlID="Grid View1"
PropertyName="S electedValue"></asp:ControlPara meter>
</FilterParameter s>
</asp:AccessDataS ource>
<asp:DetailsVie w ID="DetailsView 1" Runat="server"
AutoGenerateDel eteButton="True "
AutoGenerateEdi tButton="True"
DataSourceID="A ccessDataSource 2" DataKeyNames="a u_id"
AutoGenerateIns ertButton="True "
onitemupdated=" DetailsView1_It emUpdated"
oniteminserted= "DetailsView1_I temInserted"
onitemdeleted=" DetailsView1_It emDeleted">
</asp:DetailsView >
</div>
</form>
</body>
</html>
Nov 19 '05 #1
0 1879

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

Similar topics

2
6956
by: dba123 | last post by:
How do I take my GridView and create a function that will update -all- checkbox values for the submit button's OnClick event? I have posted both my SQLDataSource and my GridView below: <asp:SqlDataSource ID="ds_dashboard" runat="server" ConnectionString="<%$ ConnectionStrings:DashboardConn %>" SelectCommand="Get_Customer_DashboardGraphs" SelectCommandType="StoredProcedure"
0
4339
by: troyblakely | last post by:
I have a gridview which is pulling data from a SqlDataSource, the select command queries a view and the update command is a stored procedure. I'm using a stored procedure because several tables need to be updated based on the data in the gridview. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:slightsInventoryConnectionString %>" SelectCommand="SELECT * FROM " UpdateCommand="upd_Inventory"...
0
1739
by: mesut | last post by:
Hi there, I've a question. I would like to create a global update button to update all changed records gridview. e.g. A gridview contains 5 columns an 2 of the columns can be updated by the user. (other 3 are readonly) e.g. a column called Status is a dropdownlistbox the user can choose a status of the product and the other column called instructions is a text box, the user can type in any value.
1
10396
by: Evan M. | last post by:
Here's my GridView and my SqlDataSource <asp:GridView ID="ContactHistoryGrid" runat="server" AutoGenerateColumns="False" DataSourceID="ContactHistoryDS" DataKeyNames="JobHistoryID" OnRowCreated="ContactHistoryGrid_RowCreated" CssClass="GridViewTable" GridLines="None" CellSpacing="1" CellPadding="3" AllowSorting="True" AllowPaging="True"> <EmptyDataTemplate>
1
9174
by: gabe | last post by:
How do you call a client side javascript callback method after an update panel has posted back to the server? I have two update panels (A + B) with a gridview in each panel. GridView B has a Trigger to listen when GridView A posts back from a Select button. This works fine. I can get the Postback from GridView B and I am able to update formatting of GridView B in it's PreRender Event.
4
6063
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters are being populated. Integers are being passed as 0 and strings are empty regardless of what I changed them to in Edit mode on the GridView. My object method to perform the update:
5
13279
by: Luqman | last post by:
I added new rows to the GridView with the following code. I am using SqlDataSource and Sql Server 2000 Northwind Database Customers table. Dim sqlarg As New DataSourceSelectArguments Dim dv As New System.Data.DataView dv = SqlDataSource1.Select(sqlarg)
11
6060
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know if that's what's causing the behavior or not. It seems like the Update button should at least do something. When the Edit button is clicked, the grid goes into Edit mode and the Cancel button takes the grid out of Edit mode. So, I don't get what...
4
12019
by: BiffMaGriff | last post by:
Hello, I have a GridView that I put inside an update panel. I have a control that attaches to the datasource of the gridview that filters the data, databinds the gridview and then updates the update panel that the gridview is in. In my page render I put this so I could select a row by just clicking it. protected override void Render(HtmlTextWriter writer) {
0
8399
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.