Dec 11, 2010 11:27 PM|sprdaveaspnet|LINK
Update: Please tell me if this coding or way of doing this totally wrong. Here is what did:
Here is the .ASPX code:
<td><asp:RadioButton ID="ph_btwn_5_9" GroupName="RadioGroup1" runat="server" /></td>
<td><asp:RadioButton ID="RadioButton2" GroupName="RadioGroup1" runat="server" /></td>
<td><asp:RadioButton ID="RadioButton3" GroupName="RadioGroup1" runat="server" /></td>
<td><asp:Label ID="Label22" runat="server" Text="Surfaces exposed to corrosives pH between 5 and 9."></asp:Label></td>
I then went to my aspx.cs file and did this:
Added this line: SqlParameter sp28 = new SqlParameter();
protected void Button1_Click(object sender, EventArgs e)
SqlConnection con = new SqlConnection("Server=\\SQLEXPRESS2005;Database=cdf;Trusted_Connection=True;");
SqlCommand cmd = new SqlCommand("submitrecord", con);
cmd.Parameters.AddWithValue("@ph_btwn_5_9", SqlDbType.Bit).Value = ph_btwn_5_9.Checked;
cmd.CommandType = CommandType.StoredProcedure;
I then added a column name "ph_btwn_5_9"
I then went into my Stored procdure code and added the "ph_btwn_5_9 (other code omitted so easier to read)
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
ALTER PROCEDURE [dbo].[submitcdfrecord]
insert into cdf(
When I click the "Submit" button on my form, the "ph_btwn_5_9" populates with a "true" or "false"
I have 11 rows of "Yes, No, N/A" Radio Buttons. I will repeat this process for all 11 rows unless someone can tell me a better way. I am a complete newbie at this! I am sure I am doing it all wrong and the wrong way.