I am getting the above error. The error is on line 33, it says.
Here's the code:
Source Error:
Line 31:
Line 32: while(r.Read()) {
Line 33: listBox1.Items.Add(new ListItem(r["first_name"], r["first_name"])); //this is the offending line
Line 34: }
Line 35: con.Close();
Now, I figured my ASP.NET was fine, I have the following code there:
<asp:ListBox ID="listBox1" runat="server">
</asp:ListBox>
What might I be doing incorrectly here? I have the user control setup in the .aspx file, I have the correct item in my .aspx.cs file - it should work, shouldn't it? What am I missing? I'm still new to C#