ASP.NET: GridView, MS Access Data Source – One click single record update

Here is how you can update record in a gridview with just a one click.
<asp:TemplateField HeaderText=”Active”>

<asp:CheckBox ID=”ActiveCheckBox” runat=”server” Checked=’’ />


Access Data Source
<asp:AccessDataSource ID=”RepoMgt” runat=”server” DataFile=”/my_folder/mydb.mdb”
DeleteCommand=”DELETE FROM [MyCars] WHERE [ID] = ?”
InsertCommand=”INSERT INTO [MyCars] ([Active]) VALUES (?)”
SelectCommand=”SELECT * FROM [MyCars] ORDER BY [Make], [Model]”
UpdateCommand=”UPDATE [MyCars] SET [Active] = ? WHERE [ID] = ?” >

Update Parameters

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s