I have followin codes
Dim dt As DataTable
Dim str As New SqlClient.SqlCommand("select code,name from employees", con)
da = New SqlClient.SqlDataAdapter(str)
dt = New DataTable
da.Fill(dt)
dt.Columns.Add("city")
Dim cmd As New SqlClient.SqlCommand("UPDATE dt SET city=(SELECT top 1 city FROM master WHERE master.code=dt.code)", con)
cmd.ExecuteNonQuery()
it says
Invalid object name 'dt'.
How to update datatable with master table?
Please help