FancyPrairie
Programmer
Using Visual Studio, I've dragged a SQLDataSource onto my page and configured and tested it. I need to execute the Select statement defined in the SqlDataSource via code. So I assumed I would use the OleDbConnection. But, I'm unable to assign the ConnectionString of the SqlDataSource as the ConnectionSting for the OleDbConnection. Code looks like this:
My question is, how can I use the ConnectionString of the SqlDataSource as the ConnectionSting in OleDbConnecton?
Code:
using cnn as New OleDbConnection(SqlDataSource.ConnectionString)
strSQL = "Select..."
Dim oCommand as New OleDbCommand(strSQL, cnn)
cnn.Open()
...