How to display multiple records in multiple textboxes.
The Colum name of TableName is as follows.
column1 column1 column1 column4 column5 column6 column7 column8 column9 column9
collegeName dateofEntry dateofLeaving, university examPassed division subjects percentage yearOfPassing ppid
collegeName dateofEntry dateofLeaving, university examPassed division subjects, percentage yearOfPassing ppid
collegeName dateofEntry dateofLeaving, university examPassed division subjects, percentage yearOfPassing ppid
collegeName dateofEntry dateofLeaving, university examPassed division subjects, percentage yearOfPassing ppid
all the four (4) rows have a common ppid value =1
It was suppose to be 4 row not 3 row. However i need to select data into one of the tabbed pane in the jquery modal popup so that is why i would want to read data into all the TextBoxes in the tabbed pane and lastly the four row have a common column 'ppid'.
Please find below the code for the 4 rows
<table id="tblData" width="95%" runat="server">
<tr>
<th>School/College Name</th>
<th>Date of Entry</th>
<th>Date of Leaving</th>
<th>Name of Board/University</th>
<th>Exam Passed</th>
<th>Division</th>
<th>subjects</th>
<th>Percentage</th>
<th>Year of Passing</th>
</tr>
<tr>
<td><asp:TextBox ID="TextBox1" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox2" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox3" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox4" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox6" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox7" runat="server" Width="250px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox8" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox9" runat="server" Width="80px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="TextBox10" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox11" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox12" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox13" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox14" runat="server"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox15" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox16" runat="server" Width="250px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox17" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox18" runat="server" Width="80px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="TextBox19" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox20" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox21" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox22" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox23" runat="server"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox24" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox25" runat="server" Width="250px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox26" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox27" runat="server" Width="80px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="TextBox28" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox29" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox30" runat="server" Width="80px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox31" runat="server" Width="200px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox32" runat="server"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox33" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox34" runat="server" Width="250px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox35" runat="server" Width="85px"></asp:TextBox></td>
<td><asp:TextBox ID="TextBox36" runat="server" Width="80px"></asp:TextBox></td>
</tr>
</table>
private void SaveRecord(string collegeName, string dateOfEntry, string dateOfLeaving, string university, string exampassed, string division, string subjects, string percentage, string yearOfPassing)
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string query = "Select * from TableName (CollegeName,DateOfEntry,DateOfLeaving,University,Exampassed,Division,Subjects,Percentage,YearOfPassing) VALUES (@CollegeName,@DateOfEntry,@DateOfLeaving,@University,@Exampassed,@Division,@Subjects,@Percentage,@YearOfPassing) where ppid='1' ";
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlCommand cmd = new SqlCommand(query, con))
{
cmd.Parameters.AddWithValue("@CollegeName", collegeName);
cmd.Parameters.AddWithValue("@DateOfEntry", dateOfEntry);
cmd.Parameters.AddWithValue("@DateOfLeaving", dateOfLeaving);
cmd.Parameters.AddWithValue("@University", university);
cmd.Parameters.AddWithValue("@Exampassed", exampassed);
cmd.Parameters.AddWithValue("@Division", division);
cmd.Parameters.AddWithValue("@Subjects", subjects);
cmd.Parameters.AddWithValue("@Percentage", percentage);
cmd.Parameters.AddWithValue("@YearOfPassing", yearOfPassing);
con.Open();
cmd.ExecuteReader();
con.Close();
}
}
}