da = New SqlDataAdapter("Select Busunit from Product where name = @prod", dbcon)
da.SelectCommand.Parameters.Add("@prod",sqlDbType.VarChar, 24).Value = "prod"
da.Fill(ds, "Product")
In the above code, I am passing the value of prod to the sql in da and then filling the dataset in the last line.
I want to know if this is the right way to be able to pass a value in to sql in the first line above.
da.SelectCommand.Parameters.Add("@prod",sqlDbType.VarChar, 24).Value = "prod"
da.Fill(ds, "Product")
In the above code, I am passing the value of prod to the sql in da and then filling the dataset in the last line.
I want to know if this is the right way to be able to pass a value in to sql in the first line above.