<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="bedID">
<Columns>
<asp:CommandField ShowEditButton="True" />
<%--<asp:BoundField DataField="studentID" HeaderText="studentID" InsertVisible="False"
ReadOnly="True" SortExpression="studentID" />--%>
<asp:BoundField DataField="bedID" HeaderText="Bed ID" SortExpression="bedID" />
<asp:BoundField DataField="date" HeaderText="Registered Date" SortExpression="date" />
<asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
<asp:BoundField DataField="city" HeaderText="City" SortExpression="city" />
<asp:BoundField DataField="state" HeaderText="State" SortExpression="state" />
<asp:BoundField DataField="zipcode" HeaderText="Pin Code" SortExpression="zipcode" />
<asp:BoundField DataField="dobDate" HeaderText="Birth Date" SortExpression="dobDate" />
<asp:BoundField DataField="dobMonth" HeaderText="Birth Month" SortExpression="dobMonth" />
<asp:BoundField DataField="dobYear" HeaderText="Birth Year" SortExpression="dobYear" />
<asp:BoundField DataField="marital_status" HeaderText="Marital Status" SortExpression="marital_status" />
<asp:BoundField DataField="phone1" HeaderText="Phone1" SortExpression="phone1" />
<asp:BoundField DataField="phone2" HeaderText="Phone2" SortExpression="phone2" />
<asp:BoundField DataField="email" HeaderText="Email" SortExpression="email" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DBNameConnectionString %>"
SelectCommand="SELECT columns FROM [table_name]"
InsertCommand="INSERT INTO [table name] (Columns) VALUES (@)"
UpdateCommand="UPDATE [table_name] SET[columns] WHERE [ID] = @ID">
<%--<DeleteParameters>
<asp:Parameter Name="bedID" Type="Int32"/>
</DeleteParameters>--%>
<UpdateParameters>
<asp:Parameter Name="column name" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="column name" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<Columns>
<asp:CommandField ShowEditButton="True" />
<%--<asp:BoundField DataField="studentID" HeaderText="studentID" InsertVisible="False"
ReadOnly="True" SortExpression="studentID" />--%>
<asp:BoundField DataField="bedID" HeaderText="Bed ID" SortExpression="bedID" />
<asp:BoundField DataField="date" HeaderText="Registered Date" SortExpression="date" />
<asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
<asp:BoundField DataField="city" HeaderText="City" SortExpression="city" />
<asp:BoundField DataField="state" HeaderText="State" SortExpression="state" />
<asp:BoundField DataField="zipcode" HeaderText="Pin Code" SortExpression="zipcode" />
<asp:BoundField DataField="dobDate" HeaderText="Birth Date" SortExpression="dobDate" />
<asp:BoundField DataField="dobMonth" HeaderText="Birth Month" SortExpression="dobMonth" />
<asp:BoundField DataField="dobYear" HeaderText="Birth Year" SortExpression="dobYear" />
<asp:BoundField DataField="marital_status" HeaderText="Marital Status" SortExpression="marital_status" />
<asp:BoundField DataField="phone1" HeaderText="Phone1" SortExpression="phone1" />
<asp:BoundField DataField="phone2" HeaderText="Phone2" SortExpression="phone2" />
<asp:BoundField DataField="email" HeaderText="Email" SortExpression="email" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DBNameConnectionString %>"
SelectCommand="SELECT columns FROM [table_name]"
InsertCommand="INSERT INTO [table name] (Columns) VALUES (@)"
UpdateCommand="UPDATE [table_name] SET[columns] WHERE [ID] = @ID">
<%--<DeleteParameters>
<asp:Parameter Name="bedID" Type="Int32"/>
</DeleteParameters>--%>
<UpdateParameters>
<asp:Parameter Name="column name" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="column name" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
No comments:
Post a Comment