Can anyone please help me with this problem. The following code produces the error Keyword not supported: 'provider'.
Thanks
Code:
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
Dim Connect As SqlConnection = New SqlConnection
Dim Adapter As SqlDataAdapter = New SqlDataAdapter
Dim ClassyDS As DataSet = New DataSet
Dim ConnectString, SelectStatement As String
Dim Category As String
Category = Trim(Request.QueryString("Category"))
If Category <> "" Then
Header.Text = "Categories: " & Category
SelectStatement = "Select * From Ads Where Category='" & Category & "'"
Else
Header.Text = "Ad Listing"
SelectStatement = "Select * From Ads"
End If
[COLOR=red][b]ConnectString = "Provider=SQLOLEDB;UID=defaultUser" & "Data Source=Kefi\NetSDK;Inital Catalog=classydb;"
Connect.ConnectionString = ConnectString[/b][/color]
Adapter.SelectCommand = new SqlCommand(SelectStatement, Connect)
Adapter.SelectCommand.Connection.Open
Adapter.Fill(ClassyDS, "Ads")
AdsGrid.DataSource = ClassyDS.Tables("Ads")
Page.DataBind
End If
End Sub
</script>
Thanks