Click here to Skip to main content
15,796,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...

Here I need Help,

DataBase:
--------------
My Database having Three tables
1.Product ----> fields(productno primary key,productname,rate)
2.BillMaster --->(billno primary key,billdate,amount)
3.billdetails--->(billno foreignkey,productno foreign key,rate,quantity,amount)


Here my .ASPX Code
------------------
XML
<form id="form1" runat="server">
    <table class="style1">
        <tr>
            <td class="style6">
                                                                        
                <asp:Label ID="Label2" runat="server"
                    style="font-size: x-large; text-align: center" Text="BillDetails"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style6">
              
                <asp:Label ID="Label1" runat="server" Text="BillNo"></asp:Label>
    
                <asp:TextBox ID="TextBox1" runat="server" Height="21px"></asp:TextBox>
                             
                <asp:Label ID="Label3" runat="server" Text="BillDate"></asp:Label>
 
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                         
            </td>
        </tr>
        <tr>
            <td class="style6">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                    CellPadding="4" ForeColor="#333333" GridLines="None" Width="94px"
                    onrowdatabound="GridView1_RowDataBound"
                    onrowupdating="GridView1_RowUpdating" >


                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <Columns>
                        <asp:TemplateField HeaderText="ProductNo">

                        <ItemTemplate>
                        <asp:DropDownList ID="ddlproductno"  runat="server"  onselectedindexchanged="ddlproductno_SelectedIndexChanged1"
                                >


                        </asp:DropDownList>
                        </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="ProductName">

                            <ItemTemplate>
                               <asp:TextBox ID="txtproductname" runat="server" ></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="ProductRate">

                            <ItemTemplate>
                                <asp:TextBox ID="txtrate" runat="server" ></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Quantity">

                            <ItemTemplate>
                                <asp:TextBox ID="txtquantity" runat="server" ></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Amount">

                            <ItemTemplate>
                                <asp:TextBox ID="txtamount" runat="server" ></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td class="style6">
 <asp:Button ID="btnnew" runat="server" Text="New" Width="57px" onclick="btnnew_Click" />
                                                       
                <asp:Button ID="btnsave" runat="server" Text="Save" Width="57px"
                    onclick="btnsave_Click" />
                                                           
                <asp:Button ID="btnupdate" runat="server" Text="Update"
                    onclick="btnupdate_Click" />
                                        
                <asp:Button ID="btnexit" runat="server" Text="Exit"
                    Width="53px" onclick="btnexit_Click" />
            </td>
        </tr>
    </table>
    </form>


Here i need to bind all product numbers into "ddlproductno" , while i am selecting a productno, the corresponding productname,rate values sholud bind to the appropriate TEXTBOXES.

Note: I need to display all controls in a single row, i.e dropdownlist,textboxes should not repeat in multiple rows.

After Entering (no.of)Quantity into Quantity textbox, it should multiply with rate and result should display in "amount " Textbox.

We need 4 buttons out of Gridview, to perform New Insert, Edit, and delete operations.

New buton()----> to select new product
Insert()-->to save the data record into database and it should display in gridview.

Waiting for your Reply... Thanks in advance..
Posted
Updated 15-Feb-11 1:23am
v2
Comments
Sandeep Mewara 15-Feb-11 6:24am    
I see the question but not what have you tried! Any effort?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900