view and edit data from database

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 1
Reputation: ezajan is an unknown quantity at this point 
Solved Threads: 0
ezajan ezajan is offline Offline
Newbie Poster

view and edit data from database

 
0
  #1
May 2nd, 2006
hi,sir,
i woul dlike to view the data from the database n edit them.but i dont know the coding..sir,please help me sir..i m developing the system using window based.thank you
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 13
Reputation: khanayub_chand is an unknown quantity at this point 
Solved Threads: 0
khanayub_chand khanayub_chand is offline Offline
Newbie Poster

Re: view and edit data from database

 
0
  #2
May 24th, 2006
hi whats your name?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 13
Reputation: khanayub_chand is an unknown quantity at this point 
Solved Threads: 0
khanayub_chand khanayub_chand is offline Offline
Newbie Poster

Re: view and edit data from database

 
0
  #3
May 24th, 2006
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 1
Reputation: Peng is an unknown quantity at this point 
Solved Threads: 0
Peng Peng is offline Offline
Newbie Poster

Re: view and edit data from database

 
0
  #4
Jun 8th, 2006
Originally Posted by ezajan
hi,sir,
i woul dlike to view the data from the database n edit them.but i dont know the coding..sir,please help me sir..i m developing the system using window based.thank you
Use SQL-key.

http://www.tampier.de
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 3
Reputation: 2archu is an unknown quantity at this point 
Solved Threads: 0
2archu 2archu is offline Offline
Newbie Poster

Re: view and edit data from database

 
0
  #5
Jun 22nd, 2006
Hai Sir
How i can connect to SQL server database with VB.Plz replay me
immediately.This is part of our project
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 85
Reputation: williamrojas78 is an unknown quantity at this point 
Solved Threads: 4
williamrojas78's Avatar
williamrojas78 williamrojas78 is offline Offline
Junior Poster in Training

Re: view and edit data from database

 
0
  #6
Jun 26th, 2006
Hi

The way i do it is adding a datagrid to the form, then connect to the database using a oleDBconnection connection and get the dataset. Then create a dataview and set its source as the table you want to display from the dataset.

then set the dataview as the datasource of the datagrid, and that should do it.

When you close the form, make sure to check if the dataset has changes and update if necessary.


Here is the code:

  1. Private con As OleDbConnection = New OleDbConnection
  2. Private comd As OleDbCommand = New OleDbCommand("SELECT * FROM Table", con)
  3. Private dst As DataSet = New DataSet
  4. Private dvw As DataView = New DataView
  5.  
  6. sub populate_datagrid()
  7.  
  8. con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & database_file & ";Mode=Read|Write"
  9.  
  10. comd.CommandTimeout = 30 ' oledbcommand
  11. dap.SelectCommand = comd ' data adapter
  12. dst.Clear() ' clear the data set
  13. dap.TableMappings.Clear() 'clear the data_adapter before using it
  14. dap.TableMappings.Add("Table", "Table_name")
  15. dap.Fill(dst, "Table_name")
  16. dvw.Table = dst.Tables(0)
  17. dvw.RowFilter = Nothing
  18. Me.datagrid1.DataSource = dvw
  19.  
  20. End sub

regards
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC