473,378 Members | 1,493 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,378 software developers and data experts.

how can i move the data on datagrid to another datagrid? by using cmdsold button

Expand|Select|Wrap|Line Numbers
  1. Dim conn As New ADODB.Connection
  2. Dim rec As New ADODB.Recordset
  3. Dim conn2 As New ADODB.Connection
  4. Dim rec2 As New ADODB.Recordset
  5.  
  6.  
  7. Private Sub cmdSearch_Click()
  8. conn.Close
  9. conn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Documents and Settings\Admin\My Documents\MynewSystem\database\PRODUCTS.MDB"
  10. rec.CursorLocation = adUseClient
  11. rec.Open "Select * From Products where ProductNo like '%" & txtSearch.Text & "%'", conn, adOpenDynamic, adLockOptimistic
  12.  
  13.     If rec.EOF Then
  14.     MsgBox "No records Found."
  15.     Else
  16.     Set ProductGrid.DataSource = rec
  17. End If
  18. End Sub
  19.  
  20.  
  21. Private Sub cmdSold_Click()
  22.  
  23. End Sub
  24. Private Sub Command1_Click()
  25. Me.Hide
  26. Load Form2
  27. Form2.Show
  28. Exit Sub
  29. End Sub
  30.  
  31.  
  32.  
  33. Private Sub Form_Load()
  34. MLeft = (Screen.Width - Me.Width) / 2
  35. Me.Top = (Screen.Height - Me.Height) / 2
  36. conn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Documents and Settings\Admin\My Documents\MynewSystem\database\PRODUCTS.MDB"
  37. rec.CursorLocation = adUseClient
  38. rec.Open "Select * From Products", conn, adOpenDynamic, adLockOptimistic
  39. Set ProductGrid.DataSource = rec
  40. conn2.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Documents and Settings\Admin\My Documents\MynewSystem\database\Sold.mdb"
  41. rec2.CursorLocation = adUseClient
  42. rec2.Open "Select * From Sold", conn2, adOpenDynamic, adLockOptimistic
  43. Set ProductGrid2.DataSource = rec2
  44.  
  45.  
  46.  
  47.  
  48. End Sub
  49.  
  50.  
  51.  
  52.  
  53. Private Sub Products_DragDrop(Source As Control, X As Single, Y As Single)
  54.  
  55. End Sub
Feb 14 '15 #1
1 1025
twinnyfo
3,653 Expert Mod 2GB
I am not sure I understand the nature of your question. Are you merely trying to copy and paste records?
Feb 19 '15 #2

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

Similar topics

0
by: Johann Zöhrer | last post by:
Hello, I didn't find a resource in the Internet, where I can find how to move rows of a DataGrid consisting of an ArrayList. The Microsoft example,...
1
by: thegame | last post by:
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls Hello, I have an interesting dilemma. I have an ASPX page with two user controls (two ASCXs). ...
5
by: Coleen | last post by:
Hi all :-) We are using a DB2 database connection through a class module to get the data into a datagrid in an aspx web page using VB.Net. I can get the data into the first datagrid with no...
2
by: Coleen | last post by:
Hi All :-) I have a Fro?next loop where I have to calculate a grand total. I need to use that grand total to calculate percentages of data from the same For/Next loop. I can't get the grand...
2
by: wu jianhua | last post by:
how to move a row in datagrid up or down? Regards. wu jianhua
6
by: shil | last post by:
Hi, I am writing a windows app in .net 2003. I have a datagrid which gets data from a storedprocedure. My question is how can I update the data in the datagrid? I want to call another...
2
by: ameen.abdullah | last post by:
Hi Guys, I have a datagrid which is binded to dataset which is gettting data from xml. Now i need to know if i edit or add data to the datagrid, whats the best possible way to fetch it? .. i...
1
by: anjupt | last post by:
Hi, I have 2 listboxes with data fetched from database so for both the listboxes datasource is set .i tried to move data from one listbox to another listbox but Error"An unhandled exception of...
2
by: arial | last post by:
Hi all, I am learning sql server 2000/2005. Now, I need to move data from my one sql server 1 to another sql server 2. I have five tables and data schema is same on both the server. as...
2
by: sivasweety | last post by:
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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: 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...

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.