Datasource from string

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards
 
John,

A dataview is not a control, it is a view on the datatable.

Cor
 
John,

Not really. You need to create a new datasource that uses your sql string:

Dim sql as String = "SELECT * FROM Table1"
Dim con as String = "Data Source=Northwind;Initial Catalog=Table1;Integrated
Security=True"
Dim ds as DataSource = new DataSource(sql, con)

The code above is untested, though. I think it needs the sql connection
string, but I could be mistaken.

Hope that helps!
 

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