473,395 Members | 1,763 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.

How can send selected data from a datagrid to another datagrid?

I have created a List of contents in a database table which will display in Datagrid window. The user may select one or many data from the Datagrid. If data selected data should be shown in Another datagrid. If a content is not available user may be allowed to add additional 'List of contents'. The addl. data also to be included automatically in that database table. The project is for our deaf association. Advance thanks pl.
Oct 16 '09 #1
2 2028
''' may be this will help you
Expand|Select|Wrap|Line Numbers
  1. Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
  2.  
  3. If KeyCode = 13 Then
  4. If TL.State = 1 Then TL.Close
  5. TL.Open "select Field Name from Table Name where Field Name  = " & DataGrid1.text & "", con, adOpenKeyset, adLockOptimistic
  6.  
  7. '''Storing this records to another table
  8.  
  9. With TL
  10. .AddNew
  11.     ! FieldName = DataGrid1.Columns(0)
  12.     .Update
  13.     .Close
  14. End With
  15.  
  16. If TL.State = 1 Then TL.Close
  17. TL.Open "select Field Name from Tabel 2 order by Field Name", con, adOpenKeyset, adLockPessimistic
  18.  
  19. If TL.RecordCount > 0 Then
  20.    Set DataGrid2.DataSource = TL
  21. End If
  22.     End If
  23.  
Oct 21 '09 #2
Problem is in
If TL.State = 1 Then TL.Close
(TL ...not described in declaration..so please explain)
Oct 24 '09 #3

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

Similar topics

2
by: Maggie Eusebio Schock | last post by:
Hi, I would like to understand when a selected cell, selected row or selected rows in the DataGrid control ends up on the clipboard. All I know is that the selection ends up on the clipboard,...
4
by: Steve | last post by:
Visual Studio 2003 .Net / C# I have a datagrid, which is bound to a dataset at runtime when my page loads. When the user double clicks a row, I need to find out which row they have selected so...
5
by: Mojtaba Faridzad | last post by:
Hi, with SetDataBinding( ) a DataGrid shows a DataView. user can select some rows in the grid by holding cotrol key. when user clicks on Delete button, I should delete all selected rows. I am...
10
by: Luis E Valencia | last post by:
I have many datagrids on a page, and an ItemCommand on one datagrid that displays another datagrid dependin on what selected in first datagrid on the VIew Column(Item Command) How Can I keep the...
4
by: wolfgang wagner | last post by:
hi all! after successfully integrating a dropdownlist in my datagrid i have another problem: i cannot set the selected index of the dropdownlistbox. here is my code: hardware.aspx...
2
by: ecoder | last post by:
Hi I'm looking for some help regarding copying, selected datagrid items from one dataset to another... and then bind the new dataset to a another datagrid. Hope hearing from you. --...
1
by: Hans Merkl | last post by:
Hi, I must be missing something here. In a DataList and DataGrid I can use the property DataKeys to identify the selected element and get to its values. But I can't find a way to do the same in...
2
by: Lars Erik Nes | last post by:
Hi I can't get this to work. I have a CustomerForm which display data from several tables in datagridviews. In another form (opened from CustomerForm), called NewCallForm, i have a listview...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.