Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2004, 01:34 PM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kfls_83
Default How REMOVE NULL in DATA GRID

hello u all

i am working on C#.NET with SQL Server 2000 at the back..i have a database and so there are fields in the table that allow null,, so when i leave them emplty the appears <NULL> ,, and when i connect ma table to C# DataGrid there i can see this null i don't want to see this NUll in the Data Grid tell me the solution



Fadi
 
Old April 19th, 2004, 10:01 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Write the SQL query such that it returns the first non-null value for the columns that could be null. You can provide the "blank" value...

SELECT COALESCE(field1, '') AS field1, COALESCE(field2, '') AS field2

This will return the field value if it's not null, or '' if it is.





Similar Threads
Thread Thread Starter Forum Replies Last Post
To remove the under line from the grid view header shalu .NET Framework 2.0 1 February 21st, 2008 07:31 AM
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM
How to remove "null" in the datagrid. r_s_arun SQL Server 2000 2 October 20th, 2004 12:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.