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.
Code:
<asp:TemplateField HeaderText=”Active”>

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

</asp:TemplateField>


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
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s