Execute SQL Server View

  • Thread starter Thread starter RP
  • Start date Start date
R

RP

I have to pass two parameters to an SQL Server view query and then
execute the view. I also want to show the results on DataGridView. How
to do this?
 
RP,

You will have to create a SqlCommand which has the parameters for your
select statement (Views are the same as tables, you don't pass parameters to
them). Once you do that, you can pass the command to a SqlDataAdapter which
fills a DataSet, and then bind the DataSet to the DataGridView.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top