954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

view and edit data from database

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

ezajan
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 0
 

hi whats your name?

khanayub_chand
Newbie Poster
13 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

email me at [EMAIL="khanayub_chand@yahoo.com"]khanayub_chand@yahoo.com[/EMAIL]

khanayub_chand
Newbie Poster
13 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 
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

Peng
Newbie Poster
1 post since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

Hai Sir
How i can connect to SQL server database with VB.Plz replay me
immediately.This is part of our project

2archu
Newbie Poster
3 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

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:

Private con As OleDbConnection = New OleDbConnection
Private comd As OleDbCommand = New OleDbCommand("SELECT * FROM Table", con)
Private dst As DataSet = New DataSet
Private dvw As DataView = New DataView

sub populate_datagrid()

        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & database_file & ";Mode=Read|Write"

comd.CommandTimeout = 30    ' oledbcommand
dap.SelectCommand = comd    ' data adapter
dst.Clear()                              ' clear the data set
dap.TableMappings.Clear()    'clear the data_adapter before using it
dap.TableMappings.Add("Table", "Table_name")
dap.Fill(dst, "Table_name")
dvw.Table = dst.Tables(0)
dvw.RowFilter = Nothing
Me.datagrid1.DataSource = dvw

End sub


regards

williamrojas78
Junior Poster
111 posts since Jun 2005
Reputation Points: 23
Solved Threads: 10
 

It Did not work.... Permission error Help

WAFFLECOPTER
Newbie Poster
1 post since Nov 2010
Reputation Points: 10
Solved Threads: 0
 
It Did not work.... Permission error Help


which means you can't connect to your database
did you modify the code to connect to your DB ?

eladreznik
Newbie Poster
16 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You