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,

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!
 
Back
Top