家庭详细数据需要转储到数据库 [英] Family details data need to dump to database

查看:95
本文介绍了家庭详细数据需要转储到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是:
我喜欢这样的存储过程:

Hi, my question is:
I worte stored procedure like this:

create procedure Insert(@Name varchar,@DOB date,@RelationShip varchar,@Education varchar)
as
begin
Insert into Familydetails(Name,DOB,Relationship,Education) values(@Name,@DOB,@RelationShip,@Education)
end



在前端,我的设计是这样的:



In front end i have designed like this:

<table class="style1">
           <tr>
               <td>
                   Name</td>
               <td>
                   DOB</td>
               <td>
                   Relationship</td>
               <td>
                   Education</td>
           </tr>
           <tr>
               <td>
                   <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox10" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox11" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox12" runat="server"></asp:TextBox>
               </td>
           </tr>
           <tr>
               <td>
                   <asp:TextBox ID="TextBox13" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox14" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox15" runat="server"></asp:TextBox>
               </td>
               <td>
                   <asp:TextBox ID="TextBox16" runat="server"></asp:TextBox>
               </td>
           </tr>
           <tr>
               <td colspan="4" style="text-align: center">
                   <asp:Button ID="Button1" runat="server" Text="Submit" />
               </td>
           </tr>
       </table>




我的情况是我需要输入单个家庭成员的所有行(名称,DOB,关系,教育),如果单击提交按钮,则所有家庭成员的详细信息都应转到数据库表(FamilyDetails).


使用存储过程时,我需要如何在前端调用.


任何帮助将不胜感激.




My scenario is I need to enter all the rows of (Name, DOB, Relationship,Education) of single family members and if i click on submit button all the details of family members should go to database table(FamilyDetails).


With Stored procedure how i need to call in front end.


Any help will be appreciated.

推荐答案



为了帮助您搜索相同的内容,请查看以下链接.


[链接]

http://www.sqlservercentral.com/Forums/Topic454929-23-1.aspx [ ^ ]
Hi,

To help you with googling the same,please see the below links.

https://www.google.co.in/search?q=call+stored+procedure+from+c%23&aq=f&sugexp=chrome,mod=17&sourceid=chrome&ie=UTF-8[^]


Check this links for examples and help

[Link]

http://www.sqlservercentral.com/Forums/Topic454929-23-1.aspx[^]


您好,

据我了解,您要将一个家庭详细信息保存到数据库中.而且根据设计,您很困惑如何保存数据.

我建议使用gridview.在那您必须添加带文本框的ItemTemplate.因此,当您单击Submit时,您可以使用for循环获取网格视图的行数,然后将所有内容保存在数据库中.

希望您能有所想法.

谢谢,
Viprat
Hi,

As per my understand you want to save one family details into the database. And as per design you are confused how to save the data.

I suggest to use gridview. In that you have to add ItemTemplate with text box. So when you click on submit, you can user for loop for the number of rows of the grid view and save all of then in the database.

I hope you will get some idea.

Thanks,
Viprat




请参见此示例.
它会让您知道我想说什么.

http://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-ASP.Net-GridView-Control-with-TextBoxes.aspx [ http://www. aspsnippets.com/Articles/Save-and-Retrieve-Dynamic-TextBox-values-in-GridView-to-SQL-Server-Database.aspx [
Hi,

See this example.
It will gives you idea what i want to say you.

http://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx[^]

http://www.aspsnippets.com/Articles/Save-and-Retrieve-Dynamic-TextBox-values-in-GridView-to-SQL-Server-Database.aspx[^]

If you use this concept, then no need to create textboxes like this. If any family has 15 members then also you can manage all this things easily.

Thanks,
Viprat


这篇关于家庭详细数据需要转储到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆