Home » 2011 » March

Archive for March, 2011

One click gridview record update

Here is how you can update record in a gridview with just a one click. Code: <asp:TemplateField HeaderText=”Active”> <ItemTemplate> <asp:CheckBox ID=”ActiveCheckBox” runat=”server” Checked='<%# Bind(“Active”) %>’ /> <asp:LinkButton ID=”UpdateButton” runat=”server” CausesValidation=”True” CommandName=”Update” Text=”Update” /> </ItemTemplate> <HeaderStyle CssClass=”datagrid-th” /> </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] […]

Microsoft SQL Express Version

To check MSSQL Version and service pack, create new query, pass below parameters and run the query. select serverproperty(‘ProductVersion’) Version, serverproperty(‘Edition’) Edition, serverproperty(‘ProductLevel’) ProductLevel, serverproperty(‘ComputerNamePhysicalNetBIOS’) PhysicalNetBIOS, serverproperty(‘ResourceVersion’) ResourceVersion

Simple record query inside gridview

Here is simple record query inside the datagrid. I was looking for this solution which does not require code behind. Access DB structure Detail.aspx page code: <form id=“form1” runat=“server”> <div> <asp:GridView ID=”GridView1″ runat=”server” AutoGenerateColumns=”False” DataKeyNames=”ID” DataSourceID=”DetailView” GridLines=”None”> <Columns> <asp:TemplateField> <ItemTemplate> <table width=”660px” border=”0″ cellpadding=”0″ cellspacing=”0″> <tr> <td colspan=”4″> <a href=”Detail.aspx?cid=<%#Container.DataItem(“ID”)%>&pic=p1″><img src=”images/<%# Container.DataItem(“Pic1″)%>” width=”75px” height=”54px” border=”0″/></a>&nbsp; […]