<asp:GridView ID="grvStudentDetails" runat="server"
ShowFooter="True" AutoGenerateColumns="False"
CellPadding="4"
GridLines="None" OnRowDeleting="grvStudentDetails_RowDeleting">
<Columns>
<asp:BoundField DataField="RowNumber" HeaderText="" />
<asp:TemplateField HeaderText="From">
<ItemTemplate>
<asp:DropDownList ID="drpQualification" runat="server" >
<asp:ListItem Value="G">kolkata</asp:ListItem>
<asp:ListItem Value="P">Mumbai</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="To">
<ItemTemplate>
<asp:DropDownList ID="drQualification" runat="server">
<asp:ListItem Value="G">Bangalore</asp:ListItem>
<asp:ListItem Value="P">Delhi</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Travel Date">
<ItemTemplate>
<asp:TextBox ID="txtAddress" runat="server" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:Button ID="ButtonAdd" runat="server"
Text="Add New City" OnClick="ButtonAdd_Click" />
</FooterTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
</asp:GridView>
i have the following gridview in my asp page, now i want to connect all the contents means from,to, date etc..of this gridview to my database on click of save button, how i will do this, what all i have to do in my .cs file.PLZZZ HELP
protected void Button1_Click(object sender, EventArgs e)
{
string insrt = "insert into book_mas_det(book_date,book_from,book_to,travel_date,return_date,adult_pax,child_pax,travel_class,contact_name,pnr_no,tot_amt,adv_amount,travler_rmks,agent_rmks) values (@a,@b,@c,@d,@e,@f,@g,@h,@i,@j,@k,@l,@m,@n)";
MySqlCommand cmd = new MySqlCommand(insrt, conn);
cmd.Parameters.AddWithValue("@a", txtbookingdate.Text);
cmd.Parameters.AddWithValue("@b", ddlfrom.SelectedItem.Text);
cmd.Parameters.AddWithValue("@c", ddlto.SelectedItem.Text);
cmd.Parameters.AddWithValue("@d", txtdeprtr.Text);
cmd.Parameters.AddWithValue("@e", txtreturn.Text);
cmd.Parameters.AddWithValue("@f", txtadult.Text);
cmd.Parameters.AddWithValue("@g", txtchild.Text);
cmd.Parameters.AddWithValue("@h", ddlclass.SelectedItem.Text);
cmd.Parameters.AddWithValue("@i", txtcontpername.Text);
cmd.Parameters.AddWithValue("@j", txtcontmobile.Text);
cmd.Parameters.AddWithValue("@k", txtamnttocharge.Text);
cmd.Parameters.AddWithValue("@l", txtadvamnt.Text);
cmd.Parameters.AddWithValue("@m", txtcmnttrav.Text);
cmd.Parameters.AddWithValue("@n", txtcmntagnt.Text);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
string display = "Booking Details is added successfully";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + display + "');", true);
i have added my .cs code for the view1 connectivity,now how to do the connectivity for view2 and view3