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
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
dvw.Table = dst.Tables(0)
dvw.RowFilter = Nothing
Me.datagrid1.DataSource = dvw
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...