473,779 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FW: How to do a multiple select and update in a datagrid


From: "Wolffang" <ja***@techlite .co.uk>
Subject: How to do a multiple select and update in a datagrid
Date: 23 October 2004 21:28

Using Visual studio.net VB

I have a datagrid that brings records from a stored procedure.

Be selecting multiple datarows using a checkbox.
All i want to do is update a field called 'Active' datatype bit from 0 to 1
for all those records that have been selected with the checkbox and mark
another field 'User' with the name of the user who selected these items when
a update button is clicked.

checkbox needs to be disabled if the record of 'Active' is 1

multiselect will be done using the article...
http://www.codeproject.com/aspnet/Mu...Dataagrid.asp?

any solutions out there???

Nov 18 '05 #1
1 1971
I have a datagrid that has a checkbox...

when a checkboxes are clicked, i am updating the records that are checked...

This is what i have so far.... but i am geting an error.... where the
OrderID is not being passed from the datagrid "dgOrders" to the stored
procedure... but the checkbox is working... is this because i am using
FindControl???

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click

Dim dg As DataGridItem

Dim ck As CheckBox

Dim OrdID As Label

Me.SqlConnectio n1.Open()

For Each dg In dgOrders.Items

ck = dg.FindControl( "chkSelect" )

OrdID = dg.FindControl( "OrderID")

If ck.Checked = True Then

Me.SqlCommand1. Parameters("@Or derID").Value = OrdID

Me.SqlCommand1. Parameters("@Ad minUserName").V alue = lblUserName.Tex t

Me.SqlCommand1. Parameters("@Ad minProcess").Va lue = 1

Me.SqlCommand1. ExecuteNonQuery ()

End If

Next

Me.SqlConnectio n1.Close()

End Sub



"Wolffang" <ja***@techlite .co.uk> wrote in message
news:mY******** ************@pi pex.net...

From: "Wolffang" <ja***@techlite .co.uk>
Subject: How to do a multiple select and update in a datagrid
Date: 23 October 2004 21:28

Using Visual studio.net VB

I have a datagrid that brings records from a stored procedure.

Be selecting multiple datarows using a checkbox.
All i want to do is update a field called 'Active' datatype bit from 0 to
1
for all those records that have been selected with the checkbox and mark
another field 'User' with the name of the user who selected these items
when
a update button is clicked.

checkbox needs to be disabled if the record of 'Active' is 1

multiselect will be done using the article...
http://www.codeproject.com/aspnet/Mu...Dataagrid.asp?

any solutions out there???

Nov 18 '05 #2

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

Similar topics

7
7698
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official Impact Summary</td> </tr> <tr> <td colspan=2></td>
1
18250
by: Brian | last post by:
I have a dataset containing 2 tables. I need to fill a datagrid using data from both of these. If I could create a SQL Statement to fill the datagrid, it would look like this: SELECT fields.fieldname, fieldvalues.value FROM fields, fieldvalues I am having trouble finding documentation explaining how to populate
5
3530
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all selected items of that listbox and display it. can anyone help? Thanks
1
3354
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been able to find any examples which demonstrate how to do this. My Code:
9
12989
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
8
10417
by: Jason L James | last post by:
Hi all, does anyone know if I can create a dataview from multiple datatables. My dataset is constructed from four separate tables and then the relationships are added that link the tables together. To make data entry easier I would like to combine selected columns from the four tables onto a single dataview that could be used as the datasource for a datagrid control. The distinct updates, insert ans delete
4
3754
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure and username, password etc will be exactly the same for each server, the only thing that will change is the server name. Idealy I would like to get the server names from a seperate dataset so there could be any number of servers, allthough in...
3
1643
by: CharlesA | last post by:
Hi folks, I really need help with the following scenario, I'm going to describe as well as a I can what the setup is and what I can't understand I'm using the framework 1.1 using ASP.net with C# I have a datagrid that is bound to a datasource (through ADO.net) and all that works
0
3121
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td colspan="2"><p>
0
9632
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
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
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...
1
7478
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
6723
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
5372
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
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4036
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
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.