HI
below is House_info table in database
Id
|
Behtop
|
Service1
|
Service2
|
1
|
1111
|
Estate
|
Null
|
2
|
2222
|
Home
|
Home1
|
and I have 2 Textbox in page that users can enter text on them and update House_info tables column service1 and service2
below is SP:
@Service1 nvarchar(20)=NULL,
@Service2 nvarchar(20)=NULL
as
begin
update House_info set
Service1=@Service1,Service2=@Service2
END
and behind code
_cmd.Parameters.AddWithValue("@Service1", TxtMT1.Text);
_cmd.Parameters.AddWithValue("@Service2", TxtMT2.Text);
problem is that if users enter text in TB and click on button it update columns data but if they don't enter any thing in textbox it enter space in Table like:
Id
|
Behtop
|
Service1
|
Service2
|
1
|
1111
|
Estate
|
2
|
2222
|
Home
|
Home1
|
I want if users don't enter any thing in text box it insert in table "NULL"
How I can do it?
Best Regards
Neda