Messages - h0meopathic [ switch to compact view ]

Pages: prev1 [2] 3 4 5next
6
What is count(1)?
I am using SQL server and my table is as follows:

Table AppointmentName: AppID, LastName, FirstName, Email, BirthDate, Slot.

Slot gets an SelectedIndexValue from the radio button on submitClick.

On Page_Load is where I need to have the SQL statement to see how many times the value from the column "Slot" has been used.

7
You have to make a radiobuttonlist as follows

Code: HTML [Select]
  1. <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True"
  2.                    RepeatColumns="3" TextAlign="Left">
  3.                     <asp:ListItem Value="1">07:00AM-07:15AM</asp:ListItem>
  4.                     <asp:ListItem Value="2">07:15AM-07:30AM</asp:ListItem>
  5.                     <asp:ListItem Value="3">07:30AM-07:45AM</asp:ListItem>
  6.                     <asp:ListItem Value="4">07:45AM-08:00AM</asp:ListItem>
  7.                 </asp:RadioButtonList>

Then add some statements to make sure its working (inside submitButton_Click). radioButton is my label
Code: C# [Select]
  1. if (RadioButtonList1.SelectedIndex > -1)
  2.         {
  3.             radioButton.Text = "<br />you selected: " + RadioButtonList1.SelectedIndex.ToString();
  4.         }
  5.         else
  6.         {
  7.             radioButton.Text = "Select a radio button";
  8.         }

Then attache it to the database like so:
Code: C# [Select]
  1. appNameComm = new SqlCommand("INSERT INTO AppointmentName (LastName, FirstName, Email, BirthDate, Slot) " +
  2.                 "VALUES (@LastName, @FirstName, @Email, @BirthDate, @Slot)", conn);
  3. .
  4. .
  5. .
  6. appNameComm.Parameters.Add("@Slot", System.Data.SqlDbType.Int, 2);
  7.             appNameComm.Parameters["@Slot"].Value = RadioButtonList1.SelectedIndex.ToString();

8
I have 36 radio buttons in a form, all with the same groupName, and all with different IDs.  Is it possible to find out which ID is selected without fishing for it? Surely a dynamic control such as a radiobutton wouldn't have been made without a simple way of finding out which button was selected.

9
I need a way to check my database and see if a record is repeated and if it's repeated twice.

I'm making a webform that will allow the user to enter his or her personal information and select a radio button of specific times.  The radio button will correspond to a SlotID in my database. When the SlotID has been used twice I need to grey out the radio button because it can no longer be selected. Any help would be nice.

10
ASP.NET / Re: Simple form using visual web developer
« on: July 29, 2009, 03:44 PM »
I actually went with the ASP.NET book from sitepoint.com and have been able to complete most of my webform from that book. I would Highly recommend it to anyone starting out with visual web developer and ASP.NET.

However, I've come to another standstill. I need a way to check my database and see if a record is repeated and if it's repeated twice.

I'm making a webform that will allow the user to enter his or her personal information and select a radio button of specific times.  The radio button will correspond to a SlotID in my database. When the SlotID has been used twice I need to grey out the radio button because it can no longer be selected. Any help would be nice.

Pages: prev1 [2] 3 4 5next
Go to full version