.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

"String Concatenation": Not appear result Or 'Null v alue' if any column contain Null null value

Posted By:      Posted Date: September 12, 2010    Points: 0   Category :Sql Server
I write This statement to display FullName of Person SELECT CardID,( FirstName + ':' + FatherName + ':' + GrandFatherName + ':' + FamilyName) as name from PersonalData but I found he dispalay null value if any part of any columns Concatenation contain null value what the exception to make them "solution"

View Complete Post

More Related Resource Links

Display Null if Column is empty

is it possible to display Nullif my sql data is null while binding it with gridview in asp.net<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" Height="185px" Width="244px"> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="Gainsboro" /> </asp:GridView> string command="select * from user1"; DataSet ds1 = new DataSet(); ds1 = ob.getall(command); GridView1.DataSource = ds1; GridView1.DataBind(); for example like this

SSIS 2005 imports column as null

Hi, I am using SSIS 2005 to import excel files to sql server. I have a large excel file with many columns. I have one column -qty that not all rows have data for it-empty. For such rows a another column-value that i need to export is imported as NULL. If column QTY contains a value than column Value is imported fine but if column QTY is blank Value is NULL even if it does have a value. I have played with TypeGuessRows but it doesn't help. Any ideas? Thanks

Update nullable column in db to null?

Can anyone reliably get the EDS to save a nullable column to the databse as a "null" when bound to any of the controls such as "FormView"? I have tried using several different UpdateParameters (Session, ControlParamater, Parameter,  etc). I have tried setting "ConvertEmptyStringToNull" to true and leaving the property off entirely. Nothing works. On my "Inserts" it works fine. (I have made sure the column is set to nullable = true in the Entity Designer.....)

Create unique constraint on a column which has null values

Hi All, I have a table suppose 'Temp' having one of the column as 'ColA' which has some null values as well as non null values. Now i have a requirement to create a unique constraint on it. We have tried but couldnt do it.Apart from having a trigger on insert and update statements is there any other alternate. Can any one please help me on this. Thanks & Regards, Srikanth  

calling web service from SSIS return result as null



I got this result

<Result>The result is null. Either the result is null or the Web method returns void.</Result> 
 when I calling web service from SSIS. I setup HTTP connection and tested without any problem; download WSDL without any problem; I did exactly as the link: http://msdn.microsoft.com/en-us/library/ms181267.aspx. From input editor, I selected service and method. For the chosen method, there will be 3 variables (1 input parameter, 2 output parameters). For the input variable, I defined the package variable as string, and copied XML content to the variable as the value. I will select this defined package variable as the input parameter. I then moved to defined output file.
 When I run the simple package, I will get the output file as result as above. What is wron

Need to display Blank Member as a NULL in one of the column Level


 Hi ,

  1. select NON EMPTY {[Measures].[Balance], [Measures].[Peso Equiv]} ON COLUMNS,
    from [depositlib_22]
    where [REPORT DATE].[All Report Date]
    |                                                   | Balance     | Peso Equiv     |
    | All Particulars |        |                  |                | 8,286,706,398.76 | 373,066,873,125.05 |
    |         | RESIDENTS   |                  |                | 8,279,166,150.24 | 373,059,101,772.19 |
    |         |        | GOVERNMENT            |                |      68.38 |       68.38 |
    |         |        |                  | NATIONAL

Error at Infopath after deleting a listfield - Cannot insert the value NULL into column 'tp_DocId'



after deleting an unused calculated field id_2 at my sharepoint list I get the following error when creating a new item with my Infopath 2010 form (update item still works):
"The form cannot be submitted.
Exception from HRESULT: 0x80131904"

The joblog tells me:
09/28/2010 13:24:46.96  w3wp.exe (0x093C)                        0x0C7C SharePoint Foundation          Logging Correlation Data       xmnv Medium   Name=Request (POST:http://test-project.xx.intranet:80/project/ideas/_layouts/Postback.FormServer.aspx) f8ffa9c3-f81c-429b-91de-3f76739e446a
09/28/2010 13:24:47.03  w3wp.exe (0x093C)                        0x0C7C SharePoint Foundation          Logging Correlation Data       xmnv Medium   Site=/project f8ffa9c3-f81c-429b-91de-3f76739e446a
09/28/2010 13:24:47.19  w3wp.exe (0x093C)               &nbs

A tidy and efficient way of excluding rows with the same column value or equal to null


Good morning

I frequently use the pivot statement to generate columns I wish to compare, often looking for differences between the values in the columns. Quite often the pivot returns some null values which I am having some difficulty in comparing.


Rownum              Col1       col2        col3    col4  etc

1                              A             A             A     &

DetailsView - Cannot insert the value NULL into column


Can somebody tell me why I am getting this error when I try to insert data in a DetailsView 2.0? 

Cannot insert the value NULL into column 'Title', table 'C:\INETPUB\WWWROOT\TEST\APP_DATA\QUIZ.MDF.dbo.Question'; column does not allow nulls. INSERT fails.

I used the Configure Data Source wizard to set this up and Question ID is a autonumber.

When you autogenerate the Insert button on a Detailsview control and click on that button during run time the control posts back with text input areas where you are supposed to type the Title, Answer1, Answer2 etc. Obviously I typed data in to this text area labeled Title. It didn't work and that's why I'm asking about the control. Because I can't debug the control I am having a hard time figuring out where the problem is.

Here is the code and thanks for any help.

<asp:DetailsView ID="EditDetails" runat="server" Height="50px" Width="550px" AutoGenerateRows="False"  AutoGenerateInsertButton="True" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" AllowPaging="True">
                        <FooterStyle BackColor="#5D7B9D" Font-Bol

Problem inserting a null value into date column in SQL table


Hi all,

I am having a hard time inserting a null date into a SQL table.  Please be aware that I am using the Microsoft Application Data Blocks and not pure ADO.net.  I find a million examples of how to do this with ADO.net but cannot find anything about this using the MS Data Application Blocks.

Here is my VB.net code:

Save(Session("ref_no"),  txtdischarge_date.Text) 

Sub Save(ByVal ref_no As Integer, discharge_date As Date)

        SqlHelper.ExecuteNonQuery(connString, ref_no, discharge_date), "MyTableInsert")

End Sub

The textbox txtdischarge_date can either be a valid date or blank.  If it contains a valid date then the insert works properly.  But if the textbox  is blank, then I want to insert a null value into my date column.  I cannot get this to work.  I get this error when I run this and txtdischarge_date is blank:

Conversion from string "" to type 'Date' is not valid

Here is the code for my stored procedure, MyTableInsert:

ALTER Procedure MyTableInsert
   (@ref_no int,
    @discharge_date datetime = NULL)

Refresh data source view gets 'column' argument cannot be null

When I try to refresh a data source view in SQL Server 2008 BIDS, I get the error: System.Data   'column' argument cannot be null.  Parameter name: column.   How to resolve this?  The underlying tables have no data yet.

Null Value/ create new column issue in SQL


Hi, I have a database with year, month, area1, area2.  Area2 has null values in them, and i want to create a 3rd column that takes area2 value as default, but if there is a null value in the column, then it looks at taking the value from area1. 

The Third column is the kind of column that i would like to produce, but i am not sure how to write it.

See example below:

year month area1 area2

Insert NULL values into Integer column in Access 2007 tables

hi  there:

  My source data  is below and it's in CSV format

Days waited


My destination is a Number column in a 2007 access table  and the required property is set to NO

First question :

   I used a Data conversion task in DFT to convert [DT_STR] to Integer as SSIS seems to default the source as DT_STR type. However, SSIS keeps complaining that

"The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data."

I know that's because of those NULL values. how to solve this issue?


--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

Cannot insert the value NULL into column 'Cid


Hello there

I have a table called category that has tow attribute (Cid,Name) 

what can i do to insert  category name only without allow user to insert category id in my webpage, I use view detail control and make the wizard link but when run the error message appear (Cannot insert the value NULL into column 'Cid)

note the identity properties is not pass.

thank you.

Explicitly defining Clustered Index and NOT NULL constraint on Primary Key column


In the following table definition, is it necessary to explicitly define clustered index and NOT NULL constraint on Primary Key column, since defining Primary Key alone will do the job.

create table t1 (
col1 char(4) Not Null Primary Key Clustered,
col2 varchar(20)

Cannot insert NULL into a ntext type column ? Using SQL CE product version 3.5.8080.0


int          not null 
, name         nvarchar(50)  not null 
, addrLine1    nvarchar(50) null 
, addrLine2    nvarchar(50) null 
, suburb       nvarchar(30)

how to update the int not null column for each row



I have a table Called EmployeeInfo which has two column namely Employee and EmpID. EmpID is the Primary Key, INT NOT NULL but NOT IDENTITY, Employee is Varchar (50).

I have a staging table in which i have the same two columns. Now, using SSIS, i have to select the data from staging table and apply lookup, whether the Employee in staging table exists in EmployeeInfo table or not. If not then i have to insert those non-matched records into EmployeeInfo table. But, as the column EmpID of EmployeeInfo table is NOT IDENTITY, i have to insert the Max+1 value in EmpID column.

Example: If the Max EmpID is 20 then the next row should have the ID 21. Next to that would be 22, and so on.

But, in ssis pipeline, there could me thousands or row entering in the table at the same time, so how would i be able to get Max+1 value for each row,

Please help.

NOTE: My manger has asked me, not to create a new EmpID IDENTITY column and replace the present EmpID column.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend