title: Keyword not supported: 'provider'
body: <p>I'm Having this error:</p>
  
  <p>Keyword not supported: 'provider'.</p>
  
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <p>Exception Details: System.ArgumentException: Keyword not supported: 'provider'.</p>
  
  <p>Source Error: </p>
  
  <pre><code>Line 24:     {
  Line 25:         Session["id"] = e.CommandArgument.ToString();
  Line 26:         SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
  Line 27:            con.Open();
  Line 28:             SqlCommand cmd1 = new SqlCommand("INSERT INTO tb2 (id, name) SELECT id, name FROM tb1 where id='"+Session["id"].ToString()+"'", con);
  
  Source File: c:\inetpub\wwwroot\logon\page.aspx    Line: 26 
  </code></pre>
  
  <p>Here's my full code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" Debug="true" %&gt;
  &lt;%@ Import Namespace="System" %&gt;
  &lt;%@ Import Namespace="System.Data" %&gt;
  &lt;%@ Import Namespace = "System.Data.SqlClient" %&gt;
  
  &lt;script runat="server" type="css"&gt;
  
  protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          bind();
      }
  }
  protected void bind()
  {
      PendingRecordsGridview.DataSourceID = "";
      PendingRecordsGridview.DataSource = sd1;
      PendingRecordsGridview.DataBind();
   }
  protected void PendingRecordsGridview_RowCommand(object sender, GridViewCommandEventArgs e)
  {
      if (e.CommandName == "accept")
      {
          Session["id"] = e.CommandArgument.ToString();
          SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
              con.Open();
              SqlCommand cmd1 = new SqlCommand("INSERT INTO tb2 (id, name) SELECT id, name FROM tb1 where id='"+Session["id"].ToString()+"'", con);
              SqlCommand cmd2 = new SqlCommand("delete from tb1 where id='"+Session["id"].ToString()+"'", con);
              cmd1.ExecuteNonQuery();
              cmd2.ExecuteNonQuery();
              bind();
      }
  }
  &lt;/script&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;asp:GridView ID="PendingRecordsGridview" runat="server" AutoGenerateColumns="False" DataKeyNames="id" onrowcommand="PendingRecordsGridview_RowCommand" DataSourceID="sd1"&gt;
          &lt;Columns&gt;
              &lt;asp:templatefield HeaderText="Accept"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Button CommandArgument='&lt;%# Bind("id") %&gt;' ID="Button1" runat="server" CausesValidation="false" CommandName="accept" Text="Accept" /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:templatefield&gt;
              &lt;asp:templatefield HeaderText="name" SortExpression="name"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("name") %&gt;'&gt;
                      &lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Bind("name") %&gt;'&gt;
                      &lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:templatefield&gt;
              &lt;asp:templatefield HeaderText="id" SortExpression="id"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Eval("id") %&gt;'&gt;
                      &lt;/asp:Label&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label2" runat="server" Text='&lt;%# Bind("id") %&gt;'&gt;
                      &lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:templatefield&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
      &lt;asp:SqlDataSource ID="sd1" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" 
          ProviderName="&lt;%$ ConnectionStrings:ConnectionString.ProviderName %&gt;"
          SelectCommand="SELECT * FROM [tb1]" DeleteCommand="DELETE FROM [tb1] WHERE [id] = ?" InsertCommand="INSERT INTO [tb1] ([name]) VALUES (?)"  UpdateCommand="UPDATE [tb1] SET [name] = ? WHERE [id] = ?"&gt;
          &lt;DeleteParameters&gt;
              &lt;asp:parameter Name="id" Type="Int32" /&gt;
          &lt;/DeleteParameters&gt;
          &lt;UpdateParameters&gt;
              &lt;asp:parameter Name="name" Type="String" /&gt;
              &lt;asp:parameter Name="id" Type="Int32" /&gt;
          &lt;/UpdateParameters&gt;
          &lt;InsertParameters&gt;
              &lt;asp:parameter Name="name" Type="String" /&gt;
          &lt;/InsertParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;/form&gt;       
  </code></pre>
  
  <p>Web.config</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;connectionStrings&gt;
  
          &lt;add name="ConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\logon\_private\db1.mdb"
              providerName="System.Data.OleDb" /&gt;
      &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Please help! Thank you!</p>