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=Northwin d;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!
"John" wrote:
Hi
>
Is it possible to create a datasource for dataview control for an sql
string?
>
Thanks
>
Regards
>
>
>
"Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
news:626D5782-279F-4348-99E0-7643314C1CA3@mi crosoft.com...
John,
>
A dataview is not a control, it is a view on the datatable.
>
Cor
>
>
"John" <info@nospam.in fovis.co.ukschr eef in bericht
news:OqCeyuJiIH A.5160@TK2MSFTN GP05.phx.gbl...
>Hi
>>
>Is it possible to create a datasource for dataview control for an sql
>string?
>>
>Thanks
>>
>Regards
>>
Not sure though what you meant ? A string is just a string, you have to
execute the Sql statement that is stored into this string to produce a
result that can then be binded to a gridview...
"John" <info@nospam.in fovis.co.uka écrit dans le message de news:
O$ILVPSiIHA.407 6@TK2MSFTNGP05. phx.gbl...
Sorry I meant gridvview.
>
"Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
news:626D5782-279F-4348-99E0-7643314C1CA3@mi crosoft.com...
>John,
>>
>A dataview is not a control, it is a view on the datatable.
>>
>Cor
>>
>>
>"John" <info@nospam.in fovis.co.ukschr eef in bericht
>news:OqCeyuJiI HA.5160@TK2MSFT NGP05.phx.gbl.. .
>>Hi
>>>
>>Is it possible to create a datasource for dataview control for an sql
>>string?
>>>
>>Thanks
>>>
>>Regards
>>>
Comment