gents
please help on the following. I'm creating an small application where I search from the databse table tems and add the result line to a datarow of my datatable "dt", I the set the datagridviewe datatsource to this same dt.
My question is: How can I save this dt content into another table of the same database.
I'm not ussing stored procedures and dont understand much of parameters. can you please give suggestions/Ideas?
thank ypu very much
CODE
Dim cs As New SqlConnection("Data Source=myserver;Initial Catalog=mydatabase;Integrated Security=True")
Dim da As New SqlDataAdapter
Dim ds As New DataSet("Chosed")
Dim cmd As New SqlCommand
'Dim dr As DataRow = (ds.Tables("Chosed")).NewRow
cs.Open()
cmd = cs.CreateCommand
cmd.CommandText = "SELECT DESCRITION, QTTY from ITEMS WHERE CODE = '" & Trim(txtITEMSearch.Text) & "'"
da.SelectCommand = cmd
da.Fill(ds, "Chosed")
linha = dt.NewRow
linha("DESCRITION") = ds.Tables("Chosed").Rows(0).Item("DESCRITION").ToString
linha("QTTY ") = 1
dgSales.DataSource = dt
/CODE
Leo