ASP.NET code for datagrid update

ASP.NET code for datagrid update

<asp:SqlDataSource ID=”SqlDataSource1″ runat=”server” ConnectionString=”<%$ ConnectionStrings:ConnectionString2 %>”

ProviderName=”<%$ ConnectionStrings:ConnectionString2.ProviderName %>”

SelectCommand=”SELECT * FROM [employee]”

UpdateCommand=”UPDATE [employee] SET [fname] = @fname, [lname] = @lname, [department] = @department, [designation] = @designation, [address] = @address, [city] = @city, [phone] = @phone WHERE [emp_id] = @emp_id”

DeleteCommand=”DELETE FROM [employee] WHERE [emp_id] = @emp_id”

InsertCommand=”INSERT INTO [employee] ([fname], [lname], [department], [designation], [address], [city], [phone]) VALUES (@fname, @lname, @department, @designation, @address, @city, @phone)”>

<UpdateParameters>

<asp:Parameter Name=”fname” Type=”String” />

<asp:Parameter Name=”lname” Type=”String” />

<asp:Parameter Name=”department” Type=”String” />

<asp:Parameter Name=”designation” Type=”String” />

<asp:Parameter Name=”address” Type=”String” />

<asp:Parameter Name=”city” Type=”String” />

<asp:Parameter Name=”phone” Type=”String” />

<asp:Parameter Name=”emp_id” Type=”String” />

</UpdateParameters>

<DeleteParameters>

<asp:Parameter Name=”emp_id” Type=”String” />

</DeleteParameters>

<InsertParameters>

<asp:Parameter Name=”fname” Type=”String” />

<asp:Parameter Name=”lname” Type=”String” />

<asp:Parameter Name=”department” Type=”String” />

<asp:Parameter Name=”designation” Type=”String” />

<asp:Parameter Name=”address” Type=”String” />

<asp:Parameter Name=”city” Type=”String” />

<asp:Parameter Name=”phone” Type=”String” />

</InsertParameters>

</asp:SqlDataSource>

* ASP.NET code for datagrid update

R K Gupta

Hi, This is R K Gupta, an IT professional and Entrepreneur. I have written many articles yet for my websites gsesoftsolutions.com, Hope you like it. Kindly subscribe our feed for any updates. Add me in Facebook and Google+

More Posts - Website

Follow Me:
TwitterFacebookPinterestYouTube

Hi, This is R K Gupta, an IT professional and Entrepreneur. I have written many articles yet for my websites gsesoftsolutions.com, Hope you like it. Kindly subscribe our feed for any updates. Add me in Facebook and Google+

Posted in Database Management, Software Development