Beruflich Dokumente
Kultur Dokumente
</font></font>Now bind the columns of your database table to the gridview in the
following manner :<font style="color: rgb(51, 51, 153);"><font style="color:
rgb(51, 51, 153);">
</font></font> (Insert Before footer template tag.....)<font style="color: rgb(51,
51, 153);"><font style="color: rgb(51, 51, 153);">
< Columns>
< asp:TemplateField HeaderText="Name">
< ItemTemplate>
< %# Eval("Name") %>
< /ItemTemplate>
< EditItemTemplate>
< asp:TextBox ID="txtName"
runat="server" Text='<%# Bind("Name") %>' />
< /EditItemTemplate>
< ItemStyle Font-Bold="True" />
< /asp:TemplateField>
< asp:TemplateField HeaderText="Designation">
< ItemTemplate>
< %# Eval("Designation") %>
< /ItemTemplate>
< EditItemTemplate>
< asp:TextBox ID="txtDesig"
runat="server" Text='<%# Bind("Designation") %>' />
< /EditItemTemplate>
< ItemStyle Font-Bold="True" />
< /asp:TemplateField>
< asp:TemplateField HeaderText="Company">
< ItemTemplate>
< %# Eval("Company") %>
< /ItemTemplate>
< EditItemTemplate>
< asp:TextBox ID="txtComp"
runat="server" Text='<%# Bind("Company") %>' />
< /EditItemTemplate>
< ItemStyle Font-Bold="True" />
< /asp:TemplateField>
< asp:TemplateField HeaderText="Experience">
< ItemTemplate>
< %# Eval("Experience") %>
< /ItemTemplate>
< EditItemTemplate>
< asp:TextBox ID="txtExp"
runat="server" Text='<%# Bind("Experience") %>' />
< /EditItemTemplate>
< ItemStyle Font-Bold="True" />
< /asp:TemplateField>
< asp:CommandField ShowEditButton="True" />
< /Columns>
<font style="color: rgb(51, 51, 153);"> string str = "select Name, Designation,
Company, Experience from Profile";</font>
<font style="color: rgb(51, 51, 153);"> SqlDataAdapter da = new
SqlDataAdapter(str, con);</font>
........and on the page load event, we will call the function in the
following manner :
Now we are ready to run our applcation again.........so just run your
application and click on any edit button.....Gridview will appear like this :
.....................contd.