473,499 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set a field value = null in dataGrid?

J
Situation - Using the table pubs.titleauthor in a strongly typed dataset,
attached to a datagrid, using the datagrid I would like to set the
royaltyper field = null (the database allows nulls in this field). But when
click on the cell and remove the field value (leaving a blank), and move to
the next record, the blank cell is filled with the original data.

When I view the schema (.xsd file) of the strongly typed dataset, and try to
change the null value or nillable property for the royaltyper field, the
strongly typed dataset that is in the designer disappears, the program will
not run (gets errors saying the dataset does not exist).

Questions are: In a datagrid, how does one null a field that allows nulls?
How does one change field properties in the .xsd file without having the
dataset disappear?
Nov 15 '05 #1
1 3118
Hi,

The DataGridTextBoxColumn class has a NullText property. Set this property
to an empty string and the grid should treat blanks as nulls.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"J" <se******@sendspam.com> wrote in message
news:vo************@corp.supernews.com...
Situation - Using the table pubs.titleauthor in a strongly typed dataset,
attached to a datagrid, using the datagrid I would like to set the
royaltyper field = null (the database allows nulls in this field). But when click on the cell and remove the field value (leaving a blank), and move to the next record, the blank cell is filled with the original data.

When I view the schema (.xsd file) of the strongly typed dataset, and try to change the null value or nillable property for the royaltyper field, the
strongly typed dataset that is in the designer disappears, the program will not run (gets errors saying the dataset does not exist).

Questions are: In a datagrid, how does one null a field that allows nulls? How does one change field properties in the .xsd file without having the
dataset disappear?


Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
983
by: Maurice Mertens | last post by:
Hi all, I'm trying to hide the value 'null' in a bound datagrid but somehow it doesn't work. I set the .Nulltext property to a certain value: ... ... TblStyle.Add(New...
3
7011
by: Bill Clark | last post by:
I have about 20,000 records pulled from Excel that I need to update. What I need to do is run an update query that bascially says: If a field is null, update it with the previous record value of...
16
8446
by: Georges Heinesch | last post by:
Hi. My form contains a control (cboFooBar), which has an underlying field with the "Required" property set to "Yes". Now, while filling out all the controls of the form, I have to fill out this...
1
8861
by: Stu | last post by:
Hi, I am trying to return the data key field value from a dataset when I select a row in a datagrid after the datagrid has been bound to a dataset. When I an the Edit, Update and Cancel row I...
1
1082
by: Angela Chen | last post by:
I need to put a error mark beside any field that has an invalid value .In windows form , I can use errorprovider,but how to do it in asp.net web form? Thanks
5
1343
by: Alan | last post by:
I want search for a record in a table that a record's field value matching a particular value eg. customer name. What property or method of data binding manager or dataset on a form has this ?
4
2274
by: subaruwrx88011 | last post by:
So I pressed tab-enter and posted an incomplete topic, sorry. I have imported information into a database using a file. It is tab delimited and for NULL fields I have NULL. example file.txt...
2
1201
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I have a web services method getRecords(string name, string alias). In the implementation, I use the following stored procedure. How can I get the all records with alias=null. When I leave alias...
2
2253
by: thahi | last post by:
Im beginer so pls help me........................ using C#.net now we created a datagrid.then we make connection also.in a database we created a table student,the student table hav three feild...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.