Easy to solve error?

micro2007

New Member
Hey everyone- <BR>I'm new to ASP.net. I have a form with a textbox on it that looks like this: <BR><BR> <asp:TextBox id="LargeCaption" <BR> TextMode=MultiLine <BR> Rows=5 <BR> Columns=30 runat="server"></asp:TextBox> <BR> <BR>When I try to concatenate it's text into a SQL string though, I get this compile-time error: <BR><BR>Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'. <BR>Source Error: <BR><BR>strInsert &= "Filename,SmallCaption,LargeCaption,Price) " <BR>strInsert &= " VALUES ('" & c & "','" & SmallCaption.Text <BR>this line is the one that chokes----> strInsert &= "','" & LargeCaption.Text & "'," & price & ")" <BR><BR>I'm sure this is a retard-level error, could someone please help me out? <BR>What is price? Is it a textbox or a variable? When I see errors like that, it's usually because I've forgotten the .text for a textbox, so it tries to use the control itself and blows up.
 
Back
Top