I have a form view which does the basic insert functionality .However if i pass an empty string "" in the textbox of form view ,it gets converted to NULL .I am only able to insert if i pass a string " " like this .My database is SQL Server and some columns cannot be NULL,however i cannot send " " with an extra blank space.I have done the following code in ItemCreated event of FormView
Protected Sub FormView1_ItemCreated(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.ItemCreated
If FormView1.CurrentMode = FormViewMode.Insert Then
Dim WARFRAN As TextBox = DirectCast(FormView1.FindControl("WARFRANTextBox"), TextBox)
If WARFRAN IsNot Nothing Then
WARFRAN.Text = ""
End If
End Sub
for my grid view i could find a property like ConvertEmptyStringToNull="false"
but i couldnt find such a command for form view