Hey all... I'm having a trouble with text boxes. Half of the time, they aren't required, but the other half, they need a value or the form will blow up, saying it cannot be a zero-length string. Any ideas on how to fix this so the user doesn't have to type anything in?they shouldn't have to type *anything* into a textbox....unless you place a RequiredFieldValidator in there. Perhaps you have an event whose subroutine requires that textbox value as a parameter and it bombs because there is no value when the sub executes? You really need to show your code, and state what you are trying to accomplish.I'm trying to input values from a form, into a database. It just uses a simple SQL statement (Insert INTO) and asp textboxes, but for some reason when there are no values in the textboxes, it blows up. Here's the sql statement:<BR><BR> myCommand = New OleDbCommand( "Insert INTO info ( Name, Email, ScreenName ) Values ( 'Lor', '[email protected]', 'Brrred' )", myConnection )<BR> myCommand.ExecuteNonQuery()<BR><BR>and the textbox:<BR> <asp:TextBox id="txtEmail" class="box" runat="server"/><BR><BR>Thanks.<BR>your text box (txtEmail) anywhere in that SQL statement. But, to be honest with you, I've never used access with ASP.NET, just SQL Server, so I haven't bothered to learn how to do an insert in Access. I know that in SQL Server, you'd do this:<BR><BR>strInsert = "Insert info ( Name, Email, ScreenName ) Values ( @Name, @Email, @ScreenName )" <BR>myCommand = New OleDbCommand( strInsert, myConnection )<BR>myCommand.Parameters.Add("@Name", txtName.Text)<BR>myCommand.Parameters.Add("@Email", txtEmail.Text)<BR>myCommand.Parameters.Add("@ScreenName", txtScreenName.Text)<BR>myConnection.Open()<BR>myCommand.ExecuteNonQuery()<BR>myConnection.Close()<BR><BR><text boxes here><BR><BR>Of course, you'd have to use "INSERT INTO info", rather than the "INSERT info" that I have (SQL Server doesn't use the INTO key word). Anyway, I don't know if parameters are added for Access the same way as they are for SQL Server...I wouldn't be surprised if they aren't...I'll have to go look it up.<BR>and from what I could see, parameters *are* added in a similar fashion to Access, as they are in SQL Server. <BR>The sample I saw was explictly defining the datatype, which is probably a good idea anyway.<BR>So something like...<BR>myCommand.Parameters.Add("@Email",OleDbType.VarChar, 255).Value = http://aspmessageboard.com/archive/index.php/txtEmailSQL server will use insert into. I don't know about using it in the context of parameters though. I just assumed that it would since it supports it in ascii queries.In your Access database, you must make sure you have the "Allow Zero Length" option set to "Yes", and the "Required" option set to "No" if you wish to insert empty data into the table.<BR><BR><BR><BR>