View Single Post
  #2 (permalink)  
Old 08-03-2007, 11:38 PM
smani smani is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 56
smani is on a distinguished road
Smile Re: Tips and Tricks for C# .Net

hi,
here is the solution for that,
1.Go to the property window of table adapter, and select particular column(in which null value u need to allow) make the AllowDBNull-true, and NullValue property-Empty or Null(by default it is (Throw exception))
but this tricks works only for varchar column

for other column we can go for option 2

2.In our stored procedure

Create or ALTER PROCEDURE [dbo].[spName]
(
@param uniqueidentifier
)
AS
SET NOCOUNT ON;
SELECT isNull(column2,'') as column3,isNull(column3,'') as column2 FROM TableName
where column1=@param

in both the case it will send empty string if null value comes
Reply With Quote