Update record in ASp.Net GridView using SqlDataSource

Last Reply one year ago By pandeyism

Posted one year ago

I have a Dropdown list that user can select the Date and time by using them for Updating the value of GridView.

this is my Grid view:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
        <asp:CommandField ShowSelectButton="True" />
        <asp:BoundField DataField="ExamDate" HeaderText="ExamDate" SortExpression="ExamDate" />
        <asp:BoundField DataField="ExamTime" HeaderText="ExamTime" SortExpression="ExamTime" />


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:kduisdbConnectionString %>" SelectCommand="SELECT [ExamDate], [ExamTime] FROM [EDU_Course]"></asp:SqlDataSource>

I actually want to edit the date and time field of my gridview. What is the best way to do Update the date and Time of Gridview field?

How can I do this in asp.net?

Posted one year ago