everytime i load the data to datagrid the previous data is added wid the recent data?
how erase the previously loaded data in datagird?
my code is..
how erase the previously loaded data in datagird?
my code is..
Code:
cnString = "server=localhost;User Id=root;database=aries_project" 'sqlQRY = "Select * from employees_info" sqlQRY = "SELECT assigned.id,assigned.emp_id,assigned.itemno,inventory.`description`,assigned.`quantity`,inventory.amount,inventory.`amount`* assigned.`quantity` AS Amount,assigned.remarks,assigned.datetime FROM `aries_project`.`employees_info` INNER JOIN `aries_project`.`assigned` ON (`employees_info`.`emp_id` = `assigned`.`emp_id`) INNER JOIN `aries_project`.`inventory` ON (`assigned`.`itemno` = `inventory`.`itemno`) WHERE assigned.emp_id=" & Label1.Text & " " conn = New MySqlConnection(cnString) 'strSQL = "SELECT * from employees_info" conn = New MySqlConnection(cnString) Try 'Open CONNECTION conn.Open() da = New MySqlDataAdapter(sqlQRY, conn) 'create command builder Dim cb As MySqlCommandBuilder = New MySqlCommandBuilder(da) 'fill dataset da.Fill(ds, "assigned") DataGridView1.DataSource = ds DataGridView1.DataMember = "assigned" Catch ex As Common.DbException MsgBox(ex.ToString) Finally 'Close(CONNECTION) conn.Close() End Try
Comment