I have one TextBox (Name:TB_Test) If I do not input any string.... In SQL DB "test" field will get "NULL" How can i do,"test" field change blank string ,not "NULL" thank you
Michael Wu from Taiwan
Code :
SqlDataSource SqlDataSource1 = new SqlDataSource();
SqlDataSource1.UpdateParameters.Clear();
SqlDataSource1.UpdateParameters.Add("test",String.IsNullOrEmpty(TB_Test.Text.ToString()) ? "": TB_Test.Text.ToString());
SqlDataSource1.Update();
"test"with"@test"andAddwithAddWithValue- rest of your code is fine.